[Python-checkins] cpython (2.7): Issue #4106: Fix occasional exceptions printed out by multiprocessing on

antoine.pitrou python-checkins at python.org
Wed Aug 24 22:43:55 CEST 2011


http://hg.python.org/cpython/rev/d316315a8781
changeset:   72063:d316315a8781
branch:      2.7
parent:      72055:d4d9a3e71897
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Aug 24 22:41:05 2011 +0200
summary:
  Issue #4106: Fix occasional exceptions printed out by multiprocessing on interpreter shutdown.

This bug doesn't seem to exist on 3.2, where daemon threads are killed
before Py_Finalize() is entered.

files:
  Lib/multiprocessing/queues.py |  8 +-------
  Misc/NEWS                     |  3 +++
  2 files changed, 4 insertions(+), 7 deletions(-)


diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py
--- a/Lib/multiprocessing/queues.py
+++ b/Lib/multiprocessing/queues.py
@@ -188,13 +188,7 @@
         debug('... done self._thread.start()')
 
         # On process exit we will wait for data to be flushed to pipe.
-        #
-        # However, if this process created the queue then all
-        # processes which use the queue will be descendants of this
-        # process.  Therefore waiting for the queue to be flushed
-        # is pointless once all the child processes have been joined.
-        created_by_this_process = (self._opid == os.getpid())
-        if not self._joincancelled and not created_by_this_process:
+        if not self._joincancelled:
             self._jointhread = Finalize(
                 self._thread, Queue._finalize_join,
                 [weakref.ref(self._thread)],
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -40,6 +40,9 @@
 Library
 -------
 
+- Issue #4106: Fix occasional exceptions printed out by multiprocessing on
+  interpreter shutdown.
+
 - Issue #11657: Fix sending file descriptors over 255 over a multiprocessing
   Pipe.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list