gh-131913: multiprocessing: add interrupt for POSIX#132453
gh-131913: multiprocessing: add interrupt for POSIX#132453gpshead merged 18 commits intopython:mainfrom
Conversation
picnixz
left a comment
There was a problem hiding this comment.
Can you add a test where we register a signal.signal handler?
Lib/multiprocessing/process.py
Outdated
|
|
||
| def interrupt(self): | ||
| ''' | ||
| Terminate process; sends SIGINT signal or uses TerminateProcess() |
There was a problem hiding this comment.
Does it use TerminateProcess()?
Misc/NEWS.d/next/Library/2025-04-12-19-42-51.gh-issue-131913.twOx7K.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
|
🤖 New build scheduled with the buildbot fleet by @gpshead for commit 8109864 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F132453%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
| self.assertEqual(exitcode, 1) | ||
| # exit code 1 is hard-coded for uncaught exceptions | ||
| # (KeyboardInterrupt in this case) | ||
| # in multiprocessing.BaseProcess._bootstrap |
There was a problem hiding this comment.
interesting... but probably went unnoticed because these are wholly multiprocessing managed processes so the exit code reflecting the SIGINT signal was never important there like it is for our main python process which IIRC jumps through hoops to turn KeyboardInterrupt back into a SIGINT exit status.
multiprocessing.Process.interrupt#131913📚 Documentation preview 📚: https://cpython-previews--132453.org.readthedocs.build/en/132453/library/multiprocessing.html#multiprocessing.Process.interrupt