[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

Brian Quinlan report at bugs.python.org
Tue May 3 13:22:48 CEST 2011


Brian Quinlan <brian at sweetapp.com> added the comment:

> Killed by the user, or by an automatic device (such as the Linux OOM
> killer), or crashed.

Crashed would be bad - it would indicate a bug in the  
ProcessPoolExecutor code.

>
>> If the user kills a child then maybe all we want to do is raise an
>> exception rather than deadlock as a convenience.
>
> That's what the patch does, roughly.

Right. But instead of trying to recover, it might be better to fail  
very loudly i.e.
- fail every non-finished future
- kill every child process in the ProcessPoolExecutor
- set the ProcessPoolExecutor as shutdown so no new work can be  
scheduled
- raise in wait(), as_completed(), etc.

It really dependents on whether we view the situation as expected (and  
try our best to let the user recover) or as an aberrant situation that  
the user can't reasonably recover from.

Cheers,
Brian

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9205>
_______________________________________


More information about the Python-bugs-list mailing list