FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-110205: Fix asyncio ThreadedChildWatcher._join_threads() by gvanrossum · Pull Request #110884 · python/cpython · GitHub

Repository navigation

gh-110205: Fix asyncio ThreadedChildWatcher._join_threads() - #110884

Merged
gvanrossum merged 12 commits into
python:mainfrom
gvanrossum:asyncio_clear_watcher_threads
Oct 27, 2023
Merged

gvanrossum merged 12 commits into
python:mainfrom
gvanrossum:asyncio_clear_watcher_threads

Conversation

gvanrossum commented Oct 14, 2023 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

vstinner and others added 4 commits October 13, 2023 02:30
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.
gvanrossum added tests Tests in the Lib/test dir topic-asyncio skip news needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Oct 14, 2023
gvanrossum force-pushed the asyncio_clear_watcher_threads branch from fd13f23 to 566fb52 Compare October 15, 2023 00:25
gvanrossum marked this pull request as ready for review October 15, 2023 09:25

Copy link
Copy Markdown
Member Author

Reviewers, please have a look at this comment in the issue for background on what I ended up doing:
#110205 (comment)

Copy link
Copy Markdown
Member Author

@graingert I wonder if you have time to review this?

graingert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ah yeah the old _join_threads was always a noop

Copy link
Copy Markdown
Member Author

Assuming this passes I will merge it and backport to 3.12 and 3.11.

Copy link
Copy Markdown

Thanks @gvanrossum for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

gvanrossum deleted the asyncio_clear_watcher_threads branch October 27, 2023 22:44
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 <guido@python.org>

bedevere-app Bot commented Oct 27, 2023

Copy link
Copy Markdown

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 <guido@python.org>
bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 27, 2023

bedevere-app Bot commented Oct 27, 2023

Copy link
Copy Markdown

GH-111413 is a backport of this pull request to the 3.11 branch.

bedevere-app Bot removed the needs backport to 3.11 only security fixes label Oct 27, 2023
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 <guido@python.org>
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 <guido@python.org>
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

Labels

skip news tests Tests in the Lib/test dir topic-asyncio

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL