← Back to Pull requests

Handle SIGTERM already while the collectors are starting up #193

Closed
unknown closed this pull request without merging on Sep 17, 2026 13:03 UTC
View on GitHub
unknown unknown commented on Sep 12, 2026 19:34 UTC
Author

This PR changes how SIGTERM is 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

Diff: 158 lines (+118 / -40) across 1 files Reviewer: pnuu Review duration: 6809m
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
0.38
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 38.3% (MEDIUM) · Higher = larger blast radius
38.3%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.1% · Safe to merge
15.1%