Files
cpython/Doc/library
Miss Islington (bot) c8c08cfe29 [3.15] gh-115634: Fix ProcessPoolExecutor deadlock with max_tasks_per_child (GH-140900) (#152926)
gh-115634: Fix ProcessPoolExecutor deadlock with max_tasks_per_child (GH-140900)

The idle worker semaphore counts task completions, not idle workers, so
it can hold a stale token released by a worker that later exited upon
reaching its max_tasks_per_child limit. The worker replacement path
consumed such tokens and skipped spawning a replacement, deadlocking
the remaining queued tasks once no workers were left.

Replace dead workers based on len(self._processes) without consulting
the semaphore. The submit() path is unchanged, preserving on-demand
spawning and idle worker reuse.

Replace the documentation note added in GH-140897 with a versionchanged
entry now that the bug is fixed.

Based on a fix proposed by Tabrez Mohammed.
(cherry picked from commit b706767d8f)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-07-03 06:37:25 +00:00
..
2026-05-07 16:26:31 +03:00
2025-02-11 19:16:29 +02:00
2025-01-14 13:52:58 +02:00
2025-05-06 18:33:52 +03:00
2026-05-07 16:26:31 +03:00
2026-05-07 16:26:31 +03:00
2026-05-07 16:26:31 +03:00
2026-04-07 14:24:03 +03:00
2026-05-07 16:26:31 +03:00
2026-03-10 14:31:15 +02:00
2026-03-10 14:31:15 +02:00
2026-01-14 16:41:32 +02:00
2026-02-11 14:23:15 +02:00
2026-05-07 16:26:31 +03:00
2026-06-02 18:28:41 +03:00
2026-05-07 16:26:31 +03:00
2026-05-07 16:26:31 +03:00
2026-02-11 14:23:15 +02:00
2026-04-07 14:24:03 +03:00
2026-05-07 16:26:31 +03:00
2026-04-07 14:24:03 +03:00
2026-05-07 16:26:31 +03:00