A mod to the cpython multiprocessing pool class that terminates the pool when an error occurs.
A progress bar with ETA will be written to stdout on pool join, or a job total to the logger. Pool totals will not be completely accurate because the job totals aren't tracked internally by Pool.
Since this is a mod against cpython internals, it can be risky to run on unchecked versions.
The most important part is that the _timeout_join
functions does the same as join
, but with timeouts.
- Reevaluate progress bars, imports, etc
- Enable user-provided error_callback and just call mine after
- Make better
- Make pool kill optional while keeping timeout join (because pool can lock up otherwise!)[https://bugs.python.org/issue31782]
- Check on FailThreadPoolExecutor becasue it probably works, buuuuut...
When an exception is raised, the pool will be terminated and the exception re-raised.
Note that specific submit functions will need to be overridden before use.
When an exception is raised, the work queue will be purged and the pool shutdown. The exception will then be re-raised.