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 Will Starms
Recipients Will Starms
Date 2017-10-13.19:23:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507922622.85.0.213398074469.issue31782@psf.upfronthosting.co.za>
In-reply-to
Content
Pool's join function currently (3.6.3) lacks a timeout, which can cause the managing thread to sleep indefinitely when a pool worker hangs or starts misbehaving. Adding a timeout allows the owning thread to attempt a join and, after the timeout, return to other tasks, such as monitoring worker health.

In my specific situation, I have a Pool running a task on a large set of files. If any single task fails, the whole operation is ruined and the pool should be terminated. A task can communicate with the main thread through error_callback, but if the thread has already called join, it can't check until join returns, after the Pool has finished all processing.

Attached is an incredibly simple patch to the current (3.6) cpython implementation that emulates threading.thread.join's behavior.
History
Date User Action Args
2017-10-13 19:23:42Will Starmssetrecipients: + Will Starms
2017-10-13 19:23:42Will Starmssetmessageid: <1507922622.85.0.213398074469.issue31782@psf.upfronthosting.co.za>
2017-10-13 19:23:42Will Starmslinkissue31782 messages
2017-10-13 19:23:42Will Starmscreate