Handle SIGTERM already while the collectors are starting up #193
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.38) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.38 · 158 lines diff across 1 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.303
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #193"
general
weight: 0.35
pnuu
This PR changes how
SIGTERMis handled. Supersedes #191. This also fixes the tests for Python 3.14. Identified and implemented by Claude.The segment gatherer installed its SIGTERM handler only after the messaging had been set up, and the geographic gatherer only after the publisher and the triggers had been created. Both of those can take a long time, or block altogether, when the nameserver is not responding, and a SIGTERM arriving during that time killed the process instead of shutting it down cleanly. Install the handler first in both.
The tests that check the SIGTERM handling ran a collector that had been created, and mocked, in the parent process, which only works when the child process is forked. Since Python 3.14 the default start method on Linux is 'forkserver', which starts a fresh interpreter, so the mocks were not in place and the signal arrived before the handler was installed. The child processes now set themselves up, and tell the test when the signal can be sent, instead of the test sleeping for a second and hoping. The tests pass with all of 'fork', 'forkserver' and 'spawn'.
Added tests for signalling a collector that is still starting up.
Claude-Session: https://claude.ai/code/session_01H1uEcRRb7k8mNSnpneLhnK