]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-114440: Close writer pipe in multiprocessing.Queue, not concurrent.futures...
authorPetr Viktorin <encukou@gmail.com>
Wed, 24 Jan 2024 12:21:10 +0000 (13:21 +0100)
committerGitHub <noreply@github.com>
Wed, 24 Jan 2024 12:21:10 +0000 (13:21 +0100)
commitc912bc3ed41d18e7822f584008454f9bf4fff98a
treeacf9a784d08a1bbe4618a92554712da140a4f580
parent03f8f77885cd1bf802cc8945dfdb308772c471ac
[3.12] gh-114440: Close writer pipe in multiprocessing.Queue, not concurrent.futures (GH-114489)

This was left out of the 3.12 backport for three related issues:
- gh-107219 (which adds `self.call_queue._writer.close()` to `_ExecutorManagerThread` in `concurrent.futures`)
- gh-109370 (which changes this to be only called on Windows)
- gh-109047 (which moves the call to `multiprocessing.Queue`'s `_terminate_broken`)

Without this change, ProcessPoolExecutor sometimes hangs on Windows
when a worker process is terminated.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/concurrent/futures/process.py
Lib/multiprocessing/queues.py
Misc/NEWS.d/next/Library/2023-09-25-02-11-14.gh-issue-114440.b2TrqG.rst [new file with mode: 0644]