8000 gh-128041: Add a terminate_workers method to ProcessPoolExecutor by csm10495 · Pull Request #128043 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128041: Add a terminate_workers method to ProcessPoolExecutor #128043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Mar 3, 2025
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
47b162a
gh-128041 - Add a terminate_workers method to ProcessPoolExecutor
csm10495 Dec 17, 2024
6ef8833
📜🤖 Added by blurb_it.
blurb-it[bot] Dec 17, 2024
61c9b14
Fix lint
csm10495 Dec 17, 2024
3bf5464
Swap to SIGTERM as the default
csm10495 Dec 17, 2024
4b285b8
Add some tests
csm10495 Dec 17, 2024
b4939fd
Update some docs
csm10495 Dec 17, 2024
ba6a4c0
Fix docs
csm10495 Dec 17, 2024
5d58e50
Fix docs
csm10495 Dec 17, 2024
0db381b
PR fixes/updates
csm10495 Dec 17, 2024
7ae1685
SIGKILL doesn't exist on windows
csm10495 Dec 17, 2024
f7ad96c
Update Lib/concurrent/futures/process.py
csm10495 Dec 17, 2024
2c0b578
Apply suggestions from code review
csm10495 Dec 18, 2024
a878221
Fix indenting from suggestions
csm10495 Dec 18, 2024
794ee25
Internally call shutdown to prevent a resource leak when calling term…
csm10495 Dec 20, 2024
64693a7
Change test to not validate calling of os.kill since shutdown may cal…
csm10495 Dec 20, 2024
926dff1
Commit to retrigger CI
csm10495 Dec 20, 2024
6d77c10
Merge branch 'python:main' into terminate_workers
csm10495 Feb 25, 2025
4429b2f
PR feedback. Split terminate_workers into terminate_workers and kill_…
csm10495 Feb 25, 2025
b8d6e5f
Remove un-needed imports
csm10495 Feb 25, 2025
f9a7714
lint
csm10495 Feb 25, 2025
7cfa42e
Harden a test a bit to ensure the correct type of kill/terminate was …
csm10495 Feb 25, 2025
2b31fab
rekick ci
csm10495 Feb 25, 2025
ad15ee5
Allow more time for queue to get data back
csm10495 Feb 25, 2025
0f57912
Use subTest to break up tests
csm10495 Feb 26, 2025
c16fde5
Merge branch 'main' into terminate_workers
csm10495 Feb 26, 2025
1bedb28
Apply suggestions from code review
csm10495 Feb 27, 2025
f1b0cf6
PR feedback: swap to dict with constants, better subtest parameteriza…
csm10495 Feb 27, 2025
cc5f359
swap to using context in the test
csm10495 Feb 27, 2025
b3cc8a2
trailing whitespace
csm10495 Feb 27, 2025
dbf9d32
Various pr feedbacks
csm10495 Mar 2, 2025
1e16da6
PR feedback: swap name of terminate_or_kill to force_shutdown
csm10495 Mar 2, 2025
52a5326
PR feedback: swap test names
csm10495 Mar 2, 2025
7f09586
PR feedback: use self.executor_type instead of ProcessPoolExecutor di…
csm10495 Mar 2, 2025
d5f7578
Add constants for terminate/kill methods
csm10495 Mar 2, 2025
0e42eca
feedback to get below 80 chars per pep8
csm10495 Mar 2, 2025
3f55347
Merge branch 'main' into terminate_workers
csm10495 Mar 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow more time for queue to get data back
Technically this should probably be faster than the 1 second, but sometimes can be a bit slower
  • Loading branch information
csm10495 committed Feb 25, 2025
commit ad15ee5f22a7aff2362ce8a5ef3d520a4caa736a
2 changes: 1 addition & 1 deletion Lib/test/test_concurrent_futures/test_process_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def test_process_pool_executor_terminate_kill_workers(self):
executor.submit(_put_sleep_put, q)

# We should get started, but not finished since we'll terminate the workers just after
self.assertEqual(q.get(timeout=1), 'started')
self.assertEqual(q.get(timeout=5), 'started')

worker_process = list(executor._processes.values())[0]
getattr(executor, function_name)()
Expand Down
Loading
0