[New-bugs-announce] [issue39752] multiprocessing halts when child process crashes/quits

João Eiras report at bugs.python.org
Tue Feb 25 12:24:16 EST 2020


New submission from João Eiras <joao.eiras at gmail.com>:

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.

----------
components: Extension Modules
messages: 362651
nosy: João Eiras
priority: normal
severity: normal
status: open
title: multiprocessing halts when child process crashes/quits
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39752>
_______________________________________


More information about the New-bugs-announce mailing list