Repository navigation
fix(examples): discard a SIGALRM still pending as _deadline puts the handler back (#2090) - #2091
Merged
Merged
Conversation
…handler back (#2090) _deadline.__exit__ cancelled the alarm and restored the previous handler directly, so on GraalPy a SIGALRM that fired just before the cancel could be delivered to SIG_DFL afterwards and end the worker, as in #2084. Ignoring the signal first discards it. The new test holds it pending with pthread_sigmask.
Owner
Author
|
GOOD TO GO at
|
Contributor
|
Coverage: 91.54% (unit tier, Python 3.15,
Per-file detail: the |
Owner
Author
|
Ready to merge at
Merging it closes #2090. |
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.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— bug fixesDescription of your pull request and other information
Closes #2090.
examples/generators/options.py's_deadline.__exit__cancels withalarm(0)and then restores the previous handler. On GraalPy a SIGALRM that fired just before the cancel can still be pending at that point. If the handler being restored isSIG_DFL, it then kills the process. This is the defect #2084 fixed intests/_support.py(403117c98).SIG_IGNbetween the cancel and the restore, which discards a pending signal.test_a_firing_still_pending_as_the_deadline_cancels_is_discardedholds the signal pending withpthread_sigmask, so the ordering is forced. It fails without the fix ('handled': [14] != []) and skips wherepthread_sigmaskis missing, GraalPy included.make_samples.pygives byte-identicalexamples/captures/with and without the fix.