You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
multiprocessing halts when child process crashes/quits #83933
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2020-02-25.17:24:16.048>labels= ['extension-modules', 'type-bug', '3.8']
title='multiprocessing halts when child process crashes/quits'updated_at=<Date2020-02-25.17:24:16.048>user='https://bugs.python.org/JooEiras'
When one of the processes in a multiprocessing.pool picks up a task then then somehow crashes (and by crash I mean crashing the python process with something like a SEGV) or is killed, the pool in the main process will notice one of the workers died and will repopulate the pool, but it does not keep track which task was being handled by the process that died. As consequence, a caller waiting for a result will get stuck forever.
Example:
with multiprocessing.Pool(1) as pool:
result = pool.map_async(os._exit, [1]).get(timeout=2)
I found this because I was trying to use a lock with a spawned process on linux and that caused a crash and my program froze, but that is another issue.
Activity
JooEiras commentedon Feb 25, 2020
Hi.
When one of the processes in a multiprocessing.pool picks up a task then then somehow crashes (and by crash I mean crashing the python process with something like a SEGV) or is killed, the pool in the main process will notice one of the workers died and will repopulate the pool, but it does not keep track which task was being handled by the process that died. As consequence, a caller waiting for a result will get stuck forever.
Example:
with multiprocessing.Pool(1) as pool:
result = pool.map_async(os._exit, [1]).get(timeout=2)
I found this because I was trying to use a lock with a spawned process on linux and that caused a crash and my program froze, but that is another issue.
cwendling commentedon Mar 19, 2024
Looks like a duplicate of #66587, isn't it?