Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
[3.12] gh-132969: Fix exception/hang shutdown(wait=False) and a task exited abnormally#133220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…sk exited abnormallyWhen shutdown is called with wait=False, the executor thread keeps runningeven after the ProcessPoolExecutor's state is reset. The executor then triesto replenish the worker processes pool resulting in an error and a potential hangwhen it comes across a worker that has died. Fixed the issue by having_adjust_process_count() return without doing anything if the ProcessPoolExecutor'sstate has been reset.Added unit tests to validate two scenarios:max_workers < num_tasks (exception)max_workers > num_tasks (exception + hang)
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
python-cla-botbot commentedApr 30, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
thank you for the contribution,@ogbiggles. unfortunately, Python 3.12 is no longer accepting bug fixes, only security fixes. |
Got it, thanks. Submitted a new PR#133222 for main branch. |
Uh oh!
There was an error while loading.Please reload this page.
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)
ProcessPoolExecutor
raises exception or hangs the process whenshutdown(wait=False)
and worker throws exception #132969