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.

作者 jacksontj
收信人 jacksontj
日期 2015-12-18.19:41:09
SpamBayes Score -1.0
Marked as misclassified
Message-id <1450467670.78.0.386832026046.issue25908@psf.upfronthosting.co.za>
In-reply-to
内容
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
历史
日期 用户 动作 参数
2015-12-18 19:41:10jacksontj修改recipients: + jacksontj
2015-12-18 19:41:10jacksontj修改messageid: <1450467670.78.0.386832026046.issue25908@psf.upfronthosting.co.za>
2015-12-18 19:41:10jacksontj链接issue25908 messages
2015-12-18 19:41:10jacksontj创建