GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — gh-158570: Fix ProcessPoolExecutor shutdown deadlock when the result pipe is full by tfzee · Pull Request #158571 · python/cpython Conversation
|
I think that's the better solution and it looks correct to me. However, I'm not familiar with multiprocessing internals either. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: ngoldbaum <[email protected]>"
|
Gentle ping for review @gpshead |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I got GPT Sol to help me review this. The current patch looks ready to merge. Removing the shutdown-only PID write directly eliminates the deadlock: the manager has stopped draining results and is joining workers, so those writes can block forever. The integer-PID consumer was removed in #109906; worker recycling still uses We found no new regression mechanism for multithreaded callers, shutdown modes, or worker failure handling. The full test_concurrent_futures suite passed locally on Linux. Restoring just the deleted write made the new regression test fail as expected under fork, forkserver, and spawn. Additional tests with threaded callers, large results, cancellation, and worker recycling also passed. One non-blocking test caveat: Windows skips the _wlock synchronization, so deterministic reproduction is not guaranteed there. I also checked whether removing the worker's exit-time I searched the sources and upstream test repos of 33 popular packages (the snake_pit set: numpy, pandas, cython, pytest, django, sqlalchemy, uvloop, lxml, sympy, sphinx, etc.) for
All of these use only the public API. None of them reads Behaviour analysis: On 3.14, 3.15 and main, the only place the exit sentinel ( The only behaviour change is that a worker no longer writes to the result pipe on its way out, so it can no longer block there. That is the deadlock this PR fixes. Backporting: The Conclusion: this seems to have a low risk of breaking existing code. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.