This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jacksontj
Recipients jacksontj
Date 2015-12-18.19:41:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450467670.78.0.386832026046.issue25908@psf.upfronthosting.co.za>
In-reply-to
Content
If a KeyboardInterrupt is received while a worker process is grabbing an item off of the queue that worker process dies with an uncaught exception. This means that the ProcessPool now has lost a process, and currently has no mechanism to recover from dead processes. This is especially noticeable if the CallItem is relatively large (as the call_queue.get() includes all the pickle time).

A simple fix is to have the worker process not do anything with the keyboard interrupt-- since it would have no idea what to do. This cannot be implemented with a regular try/except-- as the item will be partially pulled off of the queue and lost. My proposed fix is to disable the SIGINT handler in the worker process while getting items off of the queue.

An alternate approach is to actually change multiprocessing.Queue.get() to leave the item on the queue if it is interrupted with a keyboard interrupt

to this is to catch the KeyboardInterrupt and simply continue on-- then we can rely on the caller to do the cleanup.This cannot be done by simply 


Proposed patch attached
History
Date User Action Args
2015-12-18 19:41:10jacksontjsetrecipients: + jacksontj
2015-12-18 19:41:10jacksontjsetmessageid: <1450467670.78.0.386832026046.issue25908@psf.upfronthosting.co.za>
2015-12-18 19:41:10jacksontjlinkissue25908 messages
2015-12-18 19:41:10jacksontjcreate