Closed
Description
Feature or enhancement
Proposal:
This is an interpretation of the feature ask in: https://discuss.python.org/t/cancel-running-work-in-processpoolexecutor/58605/1. It would be a way to stop all the workers running in a ProcessPoolExecutor
p = ProcessPoolExecutor()
# use p
# i know i want p to die at this point no matter what
p.terminate_workers()
Previously the way to do this was to use to loop through the ._processes
of the ProcessPoolExecutor
though, preferably this should be possible without accessing implementation details.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
Linked PRs
- gh-128041: Add a terminate_workers method to ProcessPoolExecutor #128043
- gh-128041: Try to fix transiency of test_force_shutdown_workers #130812
- Revert "gh-128041: Add
terminate_workers
andkill_workers
methods to ProcessPoolExecutor (GH-128043)" #130838 - gh-128041: Add
terminate_workers
andkill_workers
methods to ProcessPoolExecutor #130849 - gh-128041: Fix incorrect bullet placement #130900