[New-bugs-announce] [issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt

Andrey Vlasovskikh report at bugs.python.org
Sat Apr 3 05:37:15 CEST 2010

New submission from Andrey Vlasovskikh <andrey.vlasovskikh at gmail.com>:

multiprocessing.Pool methods map, imap, etc. are said to be able to normally handle exceptions. But it seems that it is true only for synchronous exceptions inside their first func arguments.

When (typically during a long-running parallel map) a user hits ^C, an asynchronous KeyboardInterrupt isn't handled properly and leads to the interpreter hangup. More precisely, children processes become <defunct> (on Linux), so the only way to terminate the whole program is to issue the KILL signal.

As stopping a program with ^C while running potentially long parallel computations is probably quite a common scenario, the interpreter should not hang up in such a case.

I'm using Python 2.6.5 (r265:79063, Mar 23 2010, 04:44:21) [GCC 4.4.3] on linux2. I've also tried to use the current multiprocessing.pool module from the current (2.7) trunk with my 2.6.5 installation, but the bug persists.

components: Library (Lib)
messages: 102219
nosy: vlasovskikh
severity: normal
status: open
title: multiprocessing.Pool hangs when issuing KeyboardInterrupt
type: crash
versions: Python 2.6, Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list