[issue8296] multiprocessing.Pool hangs when issuing KeyboardInterrupt

Andrey Vlasovskikh report at bugs.python.org
Sat Apr 3 06:07:49 CEST 2010


Andrey Vlasovskikh <andrey.vlasovskikh at gmail.com> added the comment:

Yes, I've come up with the same solution by myself, but it cannot cover all the cases of the bug. It works only for cases when ^C is hit during a call to the users' function: http://stackoverflow.com/questions/1408356/keyboard-interrupts-with-pythons-multiprocessing-pool/2561809#2561809

If the user is "lucky", he may hit ^C during getting or putting data into the queues in multiprocessing.pool.worker. To reproduce such a case, you may insert `sleep(10)` before `task = get()` or `put((job, i, result))`, for example. I've encountered such cases just by running test examples several times.

----------

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


More information about the Python-bugs-list mailing list