Keep Unix jobserver descriptors alive for configured commands #129
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.56 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
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.290
No Reviewer Assigned
no_reviewer_assigned
0.120
Sensitive Paths
sensitive_paths
0.072
Real PR Conversation Timeline
2 items
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.
MattJackson
Problem
On Unix,
Client::configure/Client::configure_makecapture the raw read/write file descriptor numbers and clearFD_CLOEXECon them in apre_exechook. TheCommandis allowed to outlive theClient(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. Thepre_exechook then clearsFD_CLOEXECon whatever now occupies those numbers, leaking unrelated descriptors into the child, while the child is told (viaMAKEFLAGS/CARGO_MAKEFLAGS) to use them as a jobserver.Fix
The Unix
configurenow clones theArcthat owns the descriptors into thepre_execclosure, so the descriptors stay open for as long as the configuredCommandexists. The public API is unchanged; the docs forconfigureandconfigure_makenote the guarantee.Tests
tests/configure-lifetime.rs(no harness) does this for bothconfigureandconfigure_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.