Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Move mute stage of __init__() after creating lock #2542

Merged
merged 1 commit into from
Apr 20, 2020

Conversation

forslund
Copy link
Collaborator

Description

During a test the speech client became unresponsive and this was seen in the logs:

  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/client/speech/mic.py", line 134, in __enter__
    return self._start()
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/client/speech/mic.py", line 146, in _start
    ), self.format, self.muted)
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/client/speech/mic.py", line 55, in __init__
    self.mute()
  File "/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/client/speech/mic.py", line 63, in mute
    with self.read_lock:
AttributeError: 'MutableStream' object has no attribute 'read_lock'

If the mic is restarted while muted the lock hadn't been created when the mute method is called causing this issue.

Contributor license agreement signed?

CLA [ Yes ]

@forslund forslund added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Apr 20, 2020
If the stream is restarted while muted this would cause an Exception
leading to an unresponsive voice client due to the read_lock being
called before creation.
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

1 similar comment
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

Copy link
Contributor

@krisgesling krisgesling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks straight forward to me 👍

@forslund forslund merged commit 0214b76 into MycroftAI:dev Apr 20, 2020
@forslund forslund deleted the bugfix/mute-before-lock branch May 5, 2020 12:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants