8000 [3.12] gh-114440: Close writer pipe in multiprocessing.Queue, not con… · naveen521kk/cpython@1ca1659 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ca1659

Browse files
encukouvstinnerserhiy-storchaka
authored andcommitted
[3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, not concurrent.futures (pythonGH-114489)
This was left out of the 3.12 backport for three related issues: - pythongh-107219 (which adds `self.call_queue._writer.close()` to `_ExecutorManagerThread` in `concurrent.futures`) - pythongh-109370 (which changes this to be only called on Windows) - pythongh-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>
1 parent cf3fcc0 commit 1ca1659

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
On Windows, closing the connection writer when cleaning up a broken
2+
:class:`multiprocessing.Queue` queue is now done for all queues, rather than
3+
only in :mod:`concurrent.futures` manager thread.
4+
This can prevent a deadlock when a ``multiprocessing`` worker process terminates
5+
without cleaning up.
6+
This completes the backport of patches by Victor Stinner and Serhiy Storchaka.

0 commit comments

Comments
 (0)
0