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
bpo-30794: added kill() method to multiprocessing.Process #2528
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
@vmsp, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @shibturn and @pitrou to be potential reviewers. |
I signed the CLA. Please re-run the check. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for posting this!
Two things are missing from this PR:
- a documentation addition in
Doc/library/multiprocessing.rst
- a NEWS entry, which you can create using the blurb tool (see "blurb add")
Lib/test/_test_multiprocessing.py
Outdated
@@ -337,6 +337,59 @@ def handler(*args): | |||
if os.name != 'nt': | |||
self.assertEqual(p.exitcode, -signal.SIGTERM) | |||
|
|||
def test_kill(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is duplicating most of test_terminate
. Perhaps those two methods could use a shared helper?
@@ -598,6 +598,10 @@ The :mod:`multiprocessing` package mostly replicates the API of the | |||
acquired a lock or semaphore etc. then terminating it is liable to | |||
cause other processes to deadlock. | |||
|
|||
.. method:: kill() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a new method, you need a versionadded
marker a well (see above the sentinel
attribute for an example).
Sorry for the delay, there's one last nit :-) If you don't have time, just say so, I can add it myself. |
No problem! Hope it's alright now. |
It is. I'm merging now. Thank you for making this! |
kill() is the same as terminate() but sends SIGKILL instead of SIGTERM. On Windows it's the same as terminate() and wasn't tested. I'd appreciate if someone could try it.