gh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2)#128011
Merged
gpshead merged 10 commits intopython:mainfrom Dec 27, 2024
Merged
Conversation
Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally cause side effects if the calling parent already had said signals blocked to begin with and did not intend to unblock them when creating a pool. Use SIG_SETMASK instead with the previous mask of blocked signals to restore the original blocked set.
…gotYF.rst Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
pthread_sigmask is not available on some platforms Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
🤖 New build scheduled with the buildbot fleet by @ZeroIntensity for commit adb54e6 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
Thanks @stephen-hansen for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Dec 27, 2024
…ed signals (try 2) (pythonGH-128011) Correct pthread_sigmask in resource_tracker to restore old signals Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally cause side effects if the calling parent already had said signals blocked to begin with and did not intend to unblock them when creating a pool. Use SIG_SETMASK instead with the previous mask of blocked signals to restore the original blocked set. (cherry picked from commit aeb9b65) Co-authored-by: Stephen Hansen <stephen.paul.hansen@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
GH-128298 is a backport of this pull request to the 3.13 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Dec 27, 2024
…ed signals (try 2) (pythonGH-128011) Correct pthread_sigmask in resource_tracker to restore old signals Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally cause side effects if the calling parent already had said signals blocked to begin with and did not intend to unblock them when creating a pool. Use SIG_SETMASK instead with the previous mask of blocked signals to restore the original blocked set. (cherry picked from commit aeb9b65) Co-authored-by: Stephen Hansen <stephen.paul.hansen@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
GH-128299 is a backport of this pull request to the 3.12 branch. |
gpshead
added a commit
that referenced
this pull request
Dec 29, 2024
…ked signals (try 2) (GH-128011) (#128298) gh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2) (GH-128011) Correct pthread_sigmask in resource_tracker to restore old signals Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally cause side effects if the calling parent already had said signals blocked to begin with and did not intend to unblock them when creating a pool. Use SIG_SETMASK instead with the previous mask of blocked signals to restore the original blocked set. (cherry picked from commit aeb9b65) Co-authored-by: Stephen Hansen <stephen.paul.hansen@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
gpshead
added a commit
that referenced
this pull request
Dec 29, 2024
…ked signals (try 2) (GH-128011) (#128299) gh-127586: multiprocessing.Pool does not properly restore blocked signals (try 2) (GH-128011) Correct pthread_sigmask in resource_tracker to restore old signals Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally cause side effects if the calling parent already had said signals blocked to begin with and did not intend to unblock them when creating a pool. Use SIG_SETMASK instead with the previous mask of blocked signals to restore the original blocked set. (cherry picked from commit aeb9b65) Co-authored-by: Stephen Hansen <stephen.paul.hansen@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
srinivasreddy
pushed a commit
to srinivasreddy/cpython
that referenced
this pull request
Jan 8, 2025
…ed signals (try 2) (pythonGH-128011) Correct pthread_sigmask in resource_tracker to restore old signals Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally cause side effects if the calling parent already had said signals blocked to begin with and did not intend to unblock them when creating a pool. Use SIG_SETMASK instead with the previous mask of blocked signals to restore the original blocked set. Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following up on buildbot failures from #127587. After some further investigation it appears the new unit test was leaking blocked signals out from it :(. I got unlucky with the random seed and my local tests passed and initial CI passed as well but later failed at buildbot. Was able to reproduce the test failure seen earlier today by explicitly blocking SIGTERM at the start of
test_resource_tracker.This is the same changes as before but have added finalization to the test to restore the blocked signals.
multiprocessing.Pooldoes not properly restore blocked signals #127586