Skip to content
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

Merged
merged 6 commits into from Jul 18, 2017
Merged

bpo-30794: added kill() method to multiprocessing.Process #2528

merged 6 commits into from Jul 18, 2017

Conversation

vmsp
Copy link
Contributor

@vmsp vmsp commented Jul 1, 2017

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.

@the-knights-who-say-ni
Copy link

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!

@mention-bot
Copy link

@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.

@vmsp
Copy link
Contributor Author

vmsp commented Jul 4, 2017

I signed the CLA. Please re-run the check. Thanks!

Copy link
Member

@pitrou pitrou left a 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")

@@ -337,6 +337,59 @@ def handler(*args):
if os.name != 'nt':
self.assertEqual(p.exitcode, -signal.SIGTERM)

def test_kill(self):
Copy link
Member

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()
Copy link
Member

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).

@pitrou
Copy link
Member

pitrou commented Jul 18, 2017

Sorry for the delay, there's one last nit :-) If you don't have time, just say so, I can add it myself.

@vmsp
Copy link
Contributor Author

vmsp commented Jul 18, 2017

No problem! Hope it's alright now.

@pitrou
Copy link
Member

pitrou commented Jul 18, 2017

It is. I'm merging now. Thank you for making this!

@pitrou pitrou merged commit ba75af7 into python:master Jul 18, 2017
@vmsp vmsp deleted the issue-30794 branch July 18, 2017 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants