Author pitrou
Recipients davin, pitrou, sbt
Date 2017-03-20.18:17:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490033848.29.0.541336006729.issue29861@psf.upfronthosting.co.za>
In-reply-to
Content
Quick patch below.  I'll make a PR once I have time to :-)

diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index ffdf426..945afa2 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -128,6 +128,8 @@ def worker(inqueue, outqueue, initializer=None, initargs=(), maxtasks=None,
             util.debug("Possible encoding error while sending result: %s" % (
                 wrapped))
             put((job, i, (False, wrapped)))
+
+        task = job = result = func = args = kwds = None
         completed += 1
     util.debug('worker exiting after %d tasks' % completed)
 
@@ -402,6 +404,8 @@ class Pool(object):
                 if set_length:
                     util.debug('doing set_length()')
                     set_length(i+1)
+            finally:
+                task = taskseq = job = None
         else:
             util.debug('task handler got sentinel')
 
@@ -445,6 +449,7 @@ class Pool(object):
                 cache[job]._set(i, obj)
             except KeyError:
                 pass
+            task = job = obj = None
 
         while cache and thread._state != TERMINATE:
             try:
@@ -461,6 +466,7 @@ class Pool(object):
                 cache[job]._set(i, obj)
             except KeyError:
                 pass
+            task = job = obj = None
 
         if hasattr(outqueue, '_reader'):
             util.debug('ensuring that outqueue is not full')
History
Date User Action Args
2017-03-20 18:17:28pitrousetrecipients: + pitrou, sbt, davin
2017-03-20 18:17:28pitrousetmessageid: <1490033848.29.0.541336006729.issue29861@psf.upfronthosting.co.za>
2017-03-20 18:17:28pitroulinkissue29861 messages
2017-03-20 18:17:28pitroucreate