precompile: Keep draining worker output when relaying it fails #65059
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.37) × (1 − Review Confidence (0.64)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 215 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 70%
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.322
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #65059"
general
weight: 0.35
maleadt
This came up while investigating CI jobs whose
precompiletest hung until the job timed out (FreeBSD and Windows i686, e.g. https://buildkite.com/julialang/julia-ci/builds/1639). We could not confirm that those hangs are this bug, because the cores were lost; in that FreeBSD job, two of the four precompile workers only dumped core once their parent was gone, which is consistent with workers blocked writing to an undrained pipe. The hang itself is easy to hit: precompiling a package that prints more than a pipe buffer while stderr goes into something that exits early (julia -e 'using Foo' 2>&1 | head) hangs instead of erroring.Each precompile worker writes to a pipe that a monitor task drains, relaying the output to the session's
io. If relaying threw (e.g. EPIPE becauseiois a closed pipe), the monitor died, nothing read the pipe any more, and the worker blocked once it filled. The parent kept the read end open and waited for the worker forever, so precompilation hung silently.A relay failure now only stops relaying for that package: its output is still captured for the final report and the pipe is drained to EOF. If the monitor stops early for any other reason, it closes the read end so the worker fails writing instead of blocking, and releasing the worker slot no longer depends on joining the monitor succeeding. The monitor is joined only in the
finally; the extra join in thecatchdates from when the failure message embedded the captured output.Backporting to 1.13 needs a small adaptation: that branch has a closure-based monitor and no cancellation tokens, so only
InterruptExceptionis rethrown there. 1.11 and 1.12 have the same hang.Assisted by: Opus 5.5, Sol 6.2