Author Amr.Ali
Recipients Amr.Ali, jnoller, sbt
Date 2014-02-15.08:08:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392451692.15.0.381545648867.issue20633@psf.upfronthosting.co.za>
In-reply-to
Content
Using `multiprocessing.Manager` to share a `dict` between two processes raises the below exception at main process termination. Child process is joined and terminates gracefully before the main process.

Replacing multiprocessing/forking.py:135 with `from multiprocessing.connection import wait` fixes the issue.

Python 3.3.1 (default, Sep 25 2013, 19:29:01) 
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version
'3.3.1 (default, Sep 25 2013, 19:29:01) \n[GCC 4.7.3]'

# multiprocessing/forking.py:135

132         def wait(self, timeout=None):                                            
133             if self.returncode is None:                                          
134                 if timeout is not None:                                          
135                     from .connection import wait                                 
136                     if not wait([self.sentinel], timeout):                       
137                         return None                                              
138                 # This shouldn't block if wait() returned successfully.          
139                 return self.poll(os.WNOHANG if timeout == 0.0 else 0)            
140             return self.returncode                                               

# Traceback

Traceback (most recent call last):
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/util.py", line 255, in _run_finalizers
    finalizer()
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/util.py", line 188, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/managers.py", line 588, in _finalize_manager
    process.join(timeout=1.0)
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/process.py", line 127, in join
    res = self._popen.wait(timeout)
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/forking.py", line 135, in wait
    from .connection import wait
SystemError: Parent module 'multiprocessing' not loaded, cannot perform relative import
Traceback (most recent call last):
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/util.py", line 255, in _run_finalizers
    finalizer()
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/util.py", line 188, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/managers.py", line 588, in _finalize_manager
    process.join(timeout=1.0)
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/process.py", line 127, in join
    res = self._popen.wait(timeout)
  File "/home/d4de/work/redacted/redacted-engine/venv/lib/python3.3/multiprocessing/forking.py", line 135, in wait
    from .connection import wait
SystemError: Parent module 'multiprocessing' not loaded, cannot perform relative import
History
Date User Action Args
2014-02-15 08:08:12Amr.Alisetrecipients: + Amr.Ali, jnoller, sbt
2014-02-15 08:08:12Amr.Alisetmessageid: <1392451692.15.0.381545648867.issue20633@psf.upfronthosting.co.za>
2014-02-15 08:08:12Amr.Alilinkissue20633 messages
2014-02-15 08:08:10Amr.Alicreate