]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-30966: concurrent.futures.Process.shutdown() closes queue (GH-19738)
authorVictor Stinner <vstinner@python.org>
Mon, 27 Apr 2020 18:53:37 +0000 (20:53 +0200)
committerGitHub <noreply@github.com>
Mon, 27 Apr 2020 18:53:37 +0000 (20:53 +0200)
Process.shutdown(wait=True) of concurrent.futures now closes
explicitly the result queue.

Lib/concurrent/futures/process.py
Misc/NEWS.d/next/Library/2020-04-27-20-27-39.bpo-30966.Xmtlqu.rst [new file with mode: 0644]

index 36355ae8756dbca67121fd55bdd2ba6b15e2491d..8e9b69a8f08b42abe8bc7c42e170fd2b876293c6 100644 (file)
@@ -728,6 +728,8 @@ class ProcessPoolExecutor(_base.Executor):
         # objects that use file descriptors.
         self._executor_manager_thread = None
         self._call_queue = None
+        if self._result_queue is not None and wait:
+            self._result_queue.close()
         self._result_queue = None
         self._processes = None
 
diff --git a/Misc/NEWS.d/next/Library/2020-04-27-20-27-39.bpo-30966.Xmtlqu.rst b/Misc/NEWS.d/next/Library/2020-04-27-20-27-39.bpo-30966.Xmtlqu.rst
new file mode 100644 (file)
index 0000000..85b7934
--- /dev/null
@@ -0,0 +1,2 @@
+``Process.shutdown(wait=True)`` of :mod:`concurrent.futures` now closes
+explicitly the result queue.