fix(scheduler): stop builds queueing behind an in-flight compile they cannot reuse #859
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 357 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.352
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #859"
general
weight: 0.35
jbellis
When many builds compile the same crate from different checkouts, they could queue behind one another for many minutes with no message. A build that finds another build already compiling the same invocation waits for it (an "in-flight" compile). If the finished result did not match its own inputs, the waiter compiled anyway, but while still holding the in-flight lock, so the next waiter waited for that compile too. On a busy host, single waits of 5 to 40 minutes were seen. Inside the waiting container there was no compiler process, so the wait looked like a hang.
Now:
This applies to both the Rust and the C/C++ compiler wrappers.
docs/how-it-works.mddescribes the waits.Tests: a new integration test holds a real compiler mid-compile. It checks that a third build can take the lock while a mismatched waiter compiles, and cannot when the first build left nothing; it fails without the release. Scheduler unit tests cover change detection (including a result published before the waiter arrives), release, the one-time warning and the limit. The integration test's compiler wrapper is released, and its process group killed, on every exit path.
Soak: on a 96-core workstation whose cache and targets are on ZFS, in a build combining this change with the other pending fixes, from 2026-10-27 23:01Z to 2026-10-28 08:01Z, under normal agent and benchmark load. Four checks and 23 snapshots found no regression attributable to the build. The window was interrupted by a host reboot. This change had already been running on two hosts since 2026-10-27 13:15Z. In the combined soak, no in-flight wait exceeded the 600 s bound (longest 371 s). The long-wait tail rose and fell with host load, from 0.26 to 27 waits over 60 s per 1,000 compiles.
AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: 2.1.306.
🤖 Generated with Claude Code