cpython/Lib/concurrent
Ajay Kamdar 598aa7cc98
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)
2025-06-10 13:28:31 +02:00
..
futures gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222) 2025-06-10 13:28:31 +02:00
__init__.py Initial implementation of PEP 3148 2010-09-18 22:35:02 +00:00