From: Antoine Pitrou Date: Wed, 24 Aug 2011 20:41:05 +0000 (+0200) Subject: Issue #4106: Fix occasional exceptions printed out by multiprocessing on interpreter... X-Git-Tag: v2.7.3rc1~492 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77657e40fa5f43fe6f7ffb6e32da4613dba657e1;p=python 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. --- diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py index 8584408c60..b7eecefa20 100644 --- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -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)], diff --git a/Misc/NEWS b/Misc/NEWS index 4be510d18b..69e0ebc7b0 100644 --- 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.