cpython/Lib/concurrent/futures
Miss Islington (bot) 6754a507c5
[3.14] gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222) (GH-135344)
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)
(cherry picked from commit 598aa7cc98)

Co-authored-by: Ajay Kamdar <140011370+ogbiggles@users.noreply.github.com>
2025-06-13 15:49:54 +02:00
..
__init__.py gh-124694: Add concurrent.futures.InterpreterPoolExecutor (gh-124548) 2024-10-16 16:50:46 -06:00
_base.py gh-132063: ensure that ProcessPoolExecutor does not swallow falsey exceptions (#132129) 2025-04-08 15:11:13 +00:00
interpreter.py [3.14] gh-134939: Add the concurrent.interpreters Module (gh-135414) 2025-06-12 08:19:26 -06:00
process.py [3.14] gh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222) (GH-135344) 2025-06-13 15:49:54 +02:00
thread.py gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid joining parent process' threads (GH-126098) 2024-11-22 18:20:34 +02:00