[Python-checkins] bpo-30966: concurrent.futures.Process.shutdown() closes queue (GH-19738)
Victor Stinner
webhook-mailer at python.org
Mon Apr 27 14:53:45 EDT 2020
https://github.com/python/cpython/commit/1a275013d1ecc2e3778d64fda86174b2f13d6969
commit: 1a275013d1ecc2e3778d64fda86174b2f13d6969
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2020年04月27日T20:53:37+02:00
summary:
bpo-30966: concurrent.futures.Process.shutdown() closes queue (GH-19738)
Process.shutdown(wait=True) of concurrent.futures now closes
explicitly the result queue.
files:
A Misc/NEWS.d/next/Library/2020-04-27-20-27-39.bpo-30966.Xmtlqu.rst
M Lib/concurrent/futures/process.py
diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py
index 36355ae8756db..8e9b69a8f08b4 100644
--- a/Lib/concurrent/futures/process.py
+++ b/Lib/concurrent/futures/process.py
@@ -728,6 +728,8 @@ def shutdown(self, wait=True, *, cancel_futures=False):
# 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
index 0000000000000..85b7934ba661e
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-04-27-20-27-39.bpo-30966.Xmtlqu.rst
@@ -0,0 +1,2 @@
+``Process.shutdown(wait=True)`` of :mod:`concurrent.futures` now closes
+explicitly the result queue.
More information about the Python-checkins
mailing list