Message304350
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. |
|
Date |
User |
Action |
Args |
2017-10-13 19:23:42 | Will Starms | set | recipients:
+ Will Starms |
2017-10-13 19:23:42 | Will Starms | set | messageid: <1507922622.85.0.213398074469.issue31782@psf.upfronthosting.co.za> |
2017-10-13 19:23:42 | Will Starms | link | issue31782 messages |
2017-10-13 19:23:42 | Will Starms | create | |
|