-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-131913: multiprocessing: add interrupt for POSIX #132453
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
Conversation
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
🤖 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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