Title: Add `terminate_workers` to `ProcessPoolExecutor` · Issue #128041 · python/cpython · GitHub
Open Graph Title: Add `terminate_workers` to `ProcessPoolExecutor` · Issue #128041 · python/cpython
X Title: Add `terminate_workers` to `ProcessPoolExecutor` · Issue #128041 · python/cpython
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...
Open Graph 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 ...
X 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 ...
Opengraph URL: https://github.com/python/cpython/issues/128041
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add `terminate_workers` to `ProcessPoolExecutor`","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nThis 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`\n\n```python\n\np = ProcessPoolExecutor()\n# use p\n\n# i know i want p to die at this point no matter what\np.terminate_workers()\n```\n\nPreviously 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.\n\n\n### Has this already been discussed elsewhere?\n\nI have already discussed this feature proposal on Discourse\n\n### Links to previous discussion of this feature:\n\nhttps://discuss.python.org/t/cancel-running-work-in-processpoolexecutor/58605/1\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-128043\n* gh-130812\n* gh-130838\n* gh-130849\n* gh-130900\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/csm10495","@type":"Person","name":"csm10495"},"datePublished":"2024-12-17T17:55:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/128041/cpython/issues/128041"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e1d3361a-128c-d382-30a0-d051e2b8f3be |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 86D4:34B6FA:77CD1B:A6DA9C:696A74E6 |
| html-safe-nonce | 6d3f38092d7217cc47e300814b371730c942404220b3c2ecc533bd10a4012872 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NkQ0OjM0QjZGQTo3N0NEMUI6QTZEQTlDOjY5NkE3NEU2IiwidmlzaXRvcl9pZCI6IjE5MTIyNjQ1MzQ1MzI5Nzc4OTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4fd33f01919f38a87f501f9653dec1d96dbae366b93a8f1810d47a3734dfed06 |
| hovercard-subject-tag | issue:2745635435 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/128041/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c2f533598790bfa26e4032ff6477448b305781e6e4cebbcca046857f1c32698f/python/cpython/issues/128041 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c2f533598790bfa26e4032ff6477448b305781e6e4cebbcca046857f1c32698f/python/cpython/issues/128041 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | csm10495 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cfa223d62d272274e0b68350b4bd7741f3ca7498b8c4b8b1bc1e6deabbdbc09d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6a0b6893c221f98f607598e939299fdf5763435d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width