classification
Title: Add multiprocessing.Process.kill()
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: davin, pitrou, vmsp
Priority: normal Keywords:

Created on 2017-06-28 20:03 by pitrou, last changed 2017-07-18 15:35 by pitrou. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2528 merged python-dev, 2017-07-01 20:43
Messages (4)
msg297216 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-06-28 20:03
subprocess.Popen() has both terminate() and kill() methods.  Under Unix, the first sends SIGTERM and the second SIGKILL.

multiprocessing.Process() only has terminate(), which sends SIGTERM.  It may be useful to add a kill() method to send SIGKILL (on Windows, kill() would be the same as terminate()).

One possible use case is when the child process has redefined the SIGTERM handler to something that doesn't trigger an exit (or takes a long time to exit).  Or if something non-interruptible is running...
msg297681 - (view) Author: Vitor Pereira (vmsp) * Date: 2017-07-04 18:24
Hey, I submitted a PR and just signed the CLA. If you could please take a look. Thanks!
msg297685 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-07-04 18:48
Thank you Vitor! I posted some review comments on your PR.
msg298600 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-07-18 15:34
New changeset ba75af713078966cc594fc7f0809ed53c532c58f by Antoine Pitrou (Vitor Pereira) in branch 'master':
bpo-30794: added kill() method to multiprocessing.Process (#2528)
https://github.com/python/cpython/commit/ba75af713078966cc594fc7f0809ed53c532c58f
History
Date User Action Args
2017-07-18 15:35:11pitrousetresolution: not a bug -> fixed
2017-07-18 15:34:58pitrousetstatus: open -> closed
resolution: not a bug
stage: needs patch -> resolved
2017-07-18 15:34:26pitrousetmessages: + msg298600
2017-07-04 18:48:36pitrousetmessages: + msg297685
2017-07-04 18:24:15vmspsetmessages: + msg297681
2017-07-01 21:15:21vmspsetnosy: + vmsp
2017-07-01 20:43:43python-devsetpull_requests: + pull_request2593
2017-06-28 20:03:41pitroucreate