fix: Preserve interruptible syscalls when registering the SIGINT handler - #28805
Open
skmendez wants to merge 1 commit into
Open
fix: Preserve interruptible syscalls when registering the SIGINT handler#28805skmendez wants to merge 1 commit into
skmendez wants to merge 1 commit into
Conversation
skmendez
force-pushed
the
fix-sigint-handler
branch
from
August 13, 2026 17:54
70211c2 to
d50f1a8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #28805 +/- ##
==========================================
+ Coverage 81.27% 81.50% +0.23%
==========================================
Files 1887 1887
Lines 266898 266916 +18
Branches 3238 3238
==========================================
+ Hits 216908 217561 +653
+ Misses 49163 48528 -635
Partials 827 827 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
skmendez
force-pushed
the
fix-sigint-handler
branch
4 times, most recently
from
August 17, 2026 16:00
c26bd19 to
b191660
Compare
skmendez
force-pushed
the
fix-sigint-handler
branch
from
August 17, 2026 16:39
b191660 to
afc4eda
Compare
skmendez
marked this pull request as ready for review
August 17, 2026 20:28
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.
Resolves #21739. Before registering the SIGINT handler, we check the current state of SA_RESTART, and if it's not already set, we disable it after running
signal_hook::low_level::register. The maintainer of signal-hook does not want to support this feature (see discourse at vorner/signal-hook#153), so options for resolving this are either to reimplement cross-platform signal handling here or to just do this sigaction workaround.Copying the minimal example from #21739 (comment):
Note that originally I tried to add unit tests for this fix, but getting a unit test of signal handling behavior working consistently on high-contention CI machines proved fairly difficult, and the original KeyboardInterrupt logic is already also untested AFAICT, so I dropped these tests. Happy to try to readd them if there's interest though.
AI usage disclosure:
I used codex to write the fix, based on the workaround discussed in vorner/signal-hook#153. This commit message and all code comments (including the SAFETY comments) were written by me. I have manually reviewed all changes and I believe they are correct.