diff options
author | Ajay Kamdar <140011370+ogbiggles@users.noreply.github.com> | 2025-06-10 07:28:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-10 13:28:31 +0200 |
commit | 598aa7cc98bc1b39f10ec41decddd8dd88799fe1 (patch) | |
tree | 64c64f7b544f09810f7ef61baaff85b885a1ad56 /Demo/parser/test_parser.py | |
parent | ee7345d507884aaaa000e51858c64852ac4f6d02 (diff) | |
download | cpython-598aa7cc98bc1b39f10ec41decddd8dd88799fe1.tar.gz cpython-598aa7cc98bc1b39f10ec41decddd8dd88799fe1.zip |
gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-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)
Diffstat (limited to 'Demo/parser/test_parser.py')
0 files changed, 0 insertions, 0 deletions