← Back to Pull requests

Keep Unix jobserver descriptors alive for configured commands #129

Open
MattJackson opened this pull request with 126 lines diff across 4 files
View on GitHub
MattJackson MattJackson commented on Nov 14, 2026 20:20 UTC
Author

Problem

On Unix, Client::configure / Client::configure_make capture the raw read/write file descriptor numbers and clear FD_CLOEXEC on them in a pre_exec hook. The Command is allowed to outlive the Client (and can be spawned more than once), so if the client is dropped before the command is spawned, its descriptors are closed and those numbers may be reused for unrelated files. The pre_exec hook then clears FD_CLOEXEC on whatever now occupies those numbers, leaking unrelated descriptors into the child, while the child is told (via MAKEFLAGS / CARGO_MAKEFLAGS) to use them as a jobserver.

Fix

The Unix configure now clones the Arc that owns the descriptors into the pre_exec closure, so the descriptors stay open for as long as the configured Command exists. The public API is unchanged; the docs for configure and configure_make note the guarantee.

Tests

tests/configure-lifetime.rs (no harness) does this for both configure and configure_make: it configures a command, drops the client, and opens two canary files that reuse the freed descriptor numbers. A control child confirms the canary descriptors are not inherited. The configured command is then spawned twice, and each time the child must read the jobserver token from the inherited descriptors.

Diff: 126 lines (+121 / -5) across 4 files Reviewer: None requested Review duration: 29212m
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.72) × (1 − Review Confidence (0.63)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.72 · 126 lines diff across 4 files
0.72
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.56 · 1 substantive comment(s)
0.56
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
63%
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.290
No Reviewer Assigned no_reviewer_assigned
0.120
Sensitive Paths sensitive_paths
0.072
Real PR Conversation Timeline
2 items
MattJackson MattJackson commented on Nov 30, 2026 00:44 UTC
Author

The four failing checks here are the macOS jobs, which GitHub cancels before they start because the macos-14 runner image is no longer available. #130 moves CI to macos-15; with it merged into this branch the whole workflow passes on my fork (https://github.com/MattJackson/jobserver-rs/tree/ci-check-129). When you have a moment, could you take a look at this one too? It keeps the jobserver descriptors alive for commands configured through Client::configure/configure_make. Happy to rebase it after #130 lands.

Reviewers
None requested
Assignees
MattJackson MattJackson
Labels
risk: low confidence: 63.3% reviewed sensitive_module
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: 71.5% (HIGH) · Higher = larger blast radius
71.5%
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: 63.3% · Lower = rushed or shallow review
63.3%
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: 26.3% · Safe to merge
26.3%