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

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

Repository navigation

gh-159689: Fix ProcessPoolExecutor hang when a worker is killed mid-result - #159697

Open
junaidkhan80121 wants to merge 8 commits into
python:mainfrom
junaidkhan80121:gh-159689-processpool-mid-send
Open

junaidkhan80121 wants to merge 8 commits into
python:mainfrom
junaidkhan80121:gh-159689-processpool-mid-send

Conversation

junaidkhan80121 commented Oct 19, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown

Summary

Fixes #159689.

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, a complete message, and SIGKILL after the result header
  • 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.

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

The remaining Windows (free-threading) x64 tail-call failure is in test_urllib2net (test_ftp_no_leak and test_ftp_timeout): ftp://www.pythontest.net returned "425 Security: Bad IP connecting." test_process_pool passed. This looks like the known runner flake from #79592. Could a triager re-run the failed job?

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.

ProcessPoolExecutor: future never completes and interpreter cannot exit when a worker is killed while sending its result

1 participant


Back | FazBrowse Home | New Git URL