]> granicus.if.org Git - python/commitdiff
Issue #4106: Fix occasional exceptions printed out by multiprocessing on interpreter...
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 24 Aug 2011 20:41:05 +0000 (22:41 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 24 Aug 2011 20:41:05 +0000 (22:41 +0200)
This bug doesn't seem to exist on 3.2, where daemon threads are killed
before Py_Finalize() is entered.

Lib/multiprocessing/queues.py
Misc/NEWS

index 8584408c60d4f3b9f9a7bce8f6baa5d84564317f..b7eecefa20a34f42417aec982d9aa1c8b7084207 100644 (file)
@@ -188,13 +188,7 @@ class Queue(object):
         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)],
index 4be510d18b339b169c35d47611bf7365f7ac2c8c..69e0ebc7b084cf5e8fa13c530b51e3b952931abb 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -40,6 +40,9 @@ Core and Builtins
 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.