Fix signal handling in `rrun` #1314
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 326 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.346
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1314"
general
weight: 0.35
wence-
Stopping an
rrunjob with Ctrl-C,killortimeoutdid not work reliably. Either nothing happened, orrrundied and left its ranks running.rrunblocked both signals before forking the ranks, and a blocked signal mask survivesforkandexec. Forwarded signals, and Ctrl-C from the terminal, stayed pending in every rank.rruncould be killed by the signal instead of forwarding it. The socket coordination server's threads (and the Slurm relay thread) were created before the signals were blocked. A signal could be delivered to one of them, which killedrrunand orphaned the ranks.rrunwaiting forever.Changes
rrunblocks SIGINT and SIGTERM at the start ofmain(), before any thread exists. A single signal thread, started right after the arguments are parsed, receives them untilrrunexits.--kill-after <s>seconds (default 30, like Slurm) or after a second signal are sent SIGKILL. The message on the first signal says that another Ctrl-C kills them right away.rrunas before.rrunwas started with.PR_SET_PDEATHSIGset to SIGKILL, so they die ifrrunitself is killed.--kill-afterhas no effect in Slurm passthrough mode, whererrunexecs the application.Tests
New
RrunSignalTestinrrun_testslaunches a realrrun(fromPATH, orRRUN_BINARY) and checks that:--kill-after,rrunis killed,rrun's controlling terminal is not forwarded.All five fail against
rrunonmain. The tests skip whenrrun_testsitself runs underrrun, so in CI they run in the final plain./rrun_testscall ofci/run_rrun_tests.sh. They take about 2.5 s in total locally, most of it the 1 s grace period in one test.