prevent shutdown from hanging on Windows#104
Open
JayDeezus wants to merge 1 commit intoKoljaB:masterfrom
Open
Conversation
on my system (Windows) queue.get() with no arguments will just hang during shutdown. I'm attempting to preserve the blocking behavior of audio_queue.get() with arguments True and 1. * True - the call still blocks, preserving your existing behavior * 1 - blocks for at most 1 second See https://docs.python.org/3/library/queue.html#queue.Queue.get for details. Specifically: """ Prior to 3.0 on POSIX systems, and for all versions on Windows, if block is true and timeout is None, this operation goes into an uninterruptible wait on an underlying lock. This means that no exceptions can occur, and in particular a SIGINT will not trigger a KeyboardInterrupt. """
Contributor
Author
|
please disregard this request, as I did not test this code enough and am still experiencing some breakage. |
Contributor
Author
|
I think my suggested edit is still valid, as without the arguments in queue.get(...) that line will hang on windows and not process a KeyboardInterrupt per the method documentation comments. I was testing my script this morning where I made a subclass inheriting AudioToTextRecorder and overloaded _recording_worker with my edits and had an inconsistent case of the reader process not terminating in time, so I wanted to run the script a few times to see if I could get some insight as to why this was happening. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
on my system (Windows) queue.get() with no arguments will just hang during shutdown. I'm attempting to preserve the blocking behavior of audio_queue.get() with arguments True and 1.
See https://docs.python.org/3/library/queue.html#queue.Queue.get for details. Specifically:
"""
Prior to 3.0 on POSIX systems, and for all versions on Windows, if block is true and timeout is None, this operation goes into an uninterruptible wait on an underlying lock. This means that no exceptions can occur, and in particular a SIGINT will not trigger a KeyboardInterrupt.
"""