gh-110205: Fix asyncio ThreadedChildWatcher._join_threads()#110884
Merged
gvanrossum merged 12 commits intopython:mainfrom Oct 27, 2023
Merged
gh-110205: Fix asyncio ThreadedChildWatcher._join_threads()#110884gvanrossum merged 12 commits intopython:mainfrom
gvanrossum merged 12 commits intopython:mainfrom
Conversation
ThreadedChildWatcher._join_threads() now clears references to completed threads. test_asyncio.utils.TestCase now calls _join_threads() of the watcher, uses SHORT_TIMEOUT to join a thread, and then raises an exception if there are still running threads. Rename also ThreadedChildWatcher threads to add "asyncio-" prefix to the name.
fd13f23 to
566fb52
Compare
Member
Author
|
Reviewers, please have a look at this comment in the issue for background on what I ended up doing: |
Member
Author
|
@graingert I wonder if you have time to review this? |
graingert
approved these changes
Oct 15, 2023
Contributor
graingert
left a comment
There was a problem hiding this comment.
Ah yeah the old _join_threads was always a noop
graingert
reviewed
Oct 15, 2023
Member
Author
|
Assuming this passes I will merge it and backport to 3.12 and 3.11. |
willingc
approved these changes
Oct 27, 2023
|
Thanks @gvanrossum for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Oct 27, 2023
…thonGH-110884) - `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything. - Threads created by that class are now named `asyncio-waitpid-NNN`. - `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`. (cherry picked from commit c3bb10c) Co-authored-by: Guido van Rossum <[email protected]>
|
GH-111412 is a backport of this pull request to the 3.12 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Oct 27, 2023
…thonGH-110884) - `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything. - Threads created by that class are now named `asyncio-waitpid-NNN`. - `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`. (cherry picked from commit c3bb10c) Co-authored-by: Guido van Rossum <[email protected]>
|
GH-111413 is a backport of this pull request to the 3.11 branch. |
gvanrossum
added a commit
that referenced
this pull request
Oct 27, 2023
…H-110884) (#111412) - `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything. - Threads created by that class are now named `asyncio-waitpid-NNN`. - `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`. (cherry picked from commit c3bb10c) Co-authored-by: Guido van Rossum <[email protected]>
gvanrossum
added a commit
that referenced
this pull request
Oct 27, 2023
…H-110884) (#111413) - `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything. - Threads created by that class are now named `asyncio-waitpid-NNN`. - `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`. (cherry picked from commit c3bb10c) Co-authored-by: Guido van Rossum <[email protected]>
iritkatriel
pushed a commit
to iritkatriel/cpython
that referenced
this pull request
Oct 29, 2023
…thon#110884) - `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything. - Threads created by that class are now named `asyncio-waitpid-NNN`. - `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`.
aisk
pushed a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
…thon#110884) - `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything. - Threads created by that class are now named `asyncio-waitpid-NNN`. - `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`.
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this pull request
Sep 2, 2024
…thon#110884) - `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything. - Threads created by that class are now named `asyncio-waitpid-NNN`. - `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`.
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.
Based on #110790, which was closed.