FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix ProcessPoolExecutor hang when a worker is killed mid-result by junaidkhan80121 · Pull Request #159696 · python/cpython · GitHub

Repository navigation

Fix ProcessPoolExecutor hang when a worker is killed mid-result - #159696

Closed
junaidkhan80121 wants to merge 1 commit into
python:mainfrom
junaidkhan80121:gh-159689-processpool-mid-send
Closed

junaidkhan80121 wants to merge 1 commit into
python:mainfrom
junaidkhan80121:gh-159689-processpool-mid-send

Conversation

junaidkhan80121 commented Oct 19, 2026 •
edited
Loading

Copy link
Copy Markdown

Summary

A ProcessPoolExecutor worker killed while writing a large result left the future pending and blocked interpreter shutdown. Connection.recv() now watches worker sentinels for the rest of the message and raises BrokenProcessPool. Callers that do not pass sentinels keep the previous behavior.

Test plan

  • ./python -m test -j4 on Linux (built from this tree): 50,080 tests, SUCCESS
  • test_concurrent_futures.test_process_pool covers a header-only message with the parent write end still open, a complete message when the sentinel is already ready, and SIGKILL after the result header on fork, forkserver, and spawn
  • macOS and Windows CI

… mid-result

A worker killed after writing part of a large result left the manager
thread blocked in Connection.recv(). The parent holds the result pipe's
write end, so that death is not delivered as EOF. Watch worker sentinels
for the rest of the message and raise BrokenProcessPool.

Co-authored-by: Cursor <cursoragent@cursor.com>

python-cla-bot Bot commented Oct 19, 2026 •
edited
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

Copy link
Copy Markdown
Author

Closing this pull request. I will open the change myself.

junaidkhan80121 deleted the gh-159689-processpool-mid-send branch October 19, 2026 07:27
junaidkhan80121 changed the title gh-159689: Fix ProcessPoolExecutor hang when a worker is killed mid-result Fix ProcessPoolExecutor hang when a worker is killed mid-result Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL