This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: multiprocessing signal defect
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Parent process hanging in multiprocessing if children terminate unexpectedly
View: 9205
Assigned To: Nosy List: Neal.Becker, asksol, neologix
Priority: normal Keywords:

Created on 2010-10-29 23:16 by Neal.Becker, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg119948 - (view) Author: Neal Becker (Neal.Becker) Date: 2010-10-29 23:16
multiprocessing signal defect
From:
Neal Becker <ndbecker2@gmail.com>
  Date:
Friday 29 October 2010 8:12:19 am
  To:
python-list@python.org
  Groups:
gmane.comp.python.general

Tested on:
python-2.6.4-27.fc13.x86_64
linux fedora 13 x86_64

Seems multiprocessing doesn't behave well with signals:

-----------
from multiprocessing import Pool
import time

def sleep (dummy):
    time.sleep (10)
    
if __name__ == '__main__':
    pool = Pool (processes=2)
    result = pool.map (sleep, range (4))
    
-------------

start it up
$ python test_multip.py 

----------------------
ps auxf | grep python
nbecker   6605  1.6  0.1 338192  6952 pts/1    Sl+  08:03   0:00  |       \_ 
python test_multip.py
nbecker   6606  0.0  0.1 186368  4760 pts/1    S+   08:03   0:00  |           
\_ python test_multip.py
nbecker   6607  0.0  0.1 186372  4740 pts/1    S+   08:03   0:00  |           
\_ python test_multip.py

kill 6607
 ps auxf | grep python
nbecker   6605  0.5  0.1 338192  6952 pts/1    Sl+  08:03   0:00  |       \_ 
python test_multip.py
nbecker   6606  0.0  0.1 186368  4760 pts/1    S+   08:03   0:00  |           
\_ python test_multip.py
nbecker   6607  0.0  0.0      0     0 pts/1    Z+   08:03   0:00  |           
\_ [python] <defunct>

 kill 6606
ps auxf | grep python
nbecker   6605  0.3  0.1 338192  6952 pts/1    Sl+  08:03   0:00  |       \_ 
python test_multip.py
nbecker   6606  0.0  0.0      0     0 pts/1    Z+   08:03   0:00  |           
\_ [python] <defunct>
nbecker   6607  0.0  0.0      0     0 pts/1    Z+   08:03   0:00  |           
\_ [python] <defunct>

Now we have 2 dead children and the parent is hung forever.

Isn't this a serious defect?
msg136126 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2011-05-16 20:36
Closing as duplicate of issue #9205.
History
Date User Action Args
2022-04-11 14:57:08adminsetgithub: 54448
2011-05-16 20:36:30neologixsetstatus: open -> closed

nosy: + neologix
messages: + msg136126

superseder: Parent process hanging in multiprocessing if children terminate unexpectedly
resolution: duplicate
2010-10-30 02:00:19brian.curtinsetnosy: + asksol
2010-10-29 23:16:54Neal.Beckercreate