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

[3.14] gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222) by miss-islington · Pull Request #135344 · python/cpython · GitHub

/ cpython Public

[3.14] gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222) - #135344

Merged
encukou merged 1 commit into
python:3.14from
miss-islington:backport-598aa7c-3.14
Jun 13, 2025
Merged

[3.14] gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222)#135344
encukou merged 1 commit into
python:3.14from
miss-islington:backport-598aa7c-3.14

Conversation

miss-islington commented Jun 10, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

When shutdown is called with wait=False, the executor thread keeps running
even after the ProcessPoolExecutor's state is reset. The executor then tries
to replenish the worker processes pool resulting in an error and a potential hang
when it comes across a worker that has died. Fixed the issue by having
_adjust_process_count() return without doing anything if the ProcessPoolExecutor's
state has been reset.

Added unit tests to validate two scenarios:
max_workers < num_tasks (exception)
max_workers > num_tasks (exception + hang)
(cherry picked from commit 598aa7c)

Co-authored-by: Ajay Kamdar 140011370+ogbiggles@users.noreply.github.com

…ited abnormally (pythonGH-133222)

When shutdown is called with wait=False, the executor thread keeps running
even after the ProcessPoolExecutor's state is reset. The executor then tries
to replenish the worker processes pool resulting in an error and a potential hang
when it comes across a worker that has died. Fixed the issue by having
_adjust_process_count() return without doing anything if the ProcessPoolExecutor's
state has been reset.

Added unit tests to validate two scenarios:
max_workers < num_tasks (exception)
max_workers > num_tasks (exception + hang)
(cherry picked from commit 598aa7c)

Co-authored-by: Ajay Kamdar <140011370+ogbiggles@users.noreply.github.com>

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit c09f4a7 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135344%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 11, 2025
encukou merged commit 6754a50 into python:3.14 Jun 13, 2025
miss-islington deleted the backport-598aa7c-3.14 branch January 2, 2026 17:46
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL