Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2776 +/- ##
==========================================
+ Coverage 78.54% 78.55% +0.01%
==========================================
Files 74 74
Lines 44039 44045 +6
==========================================
+ Hits 34591 34601 +10
+ Misses 9448 9444 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
32fc12f to
5cf5942
Compare
|
The dist-tests failure here was pre-existing on the base I branched from rather than from this change: main at 7cd4f2c fails the same two tests with nothing applied ( On the CodSpeed report: it flags the same 46% regression on this PR and on #2777, and it also notes "Different runtime environments detected". This change turns one |
5cf5942 to
0a35d3b
Compare
0a35d3b to
40e2f96
Compare
get_signal did `status.signal().expect("must have signal")`, assuming the
Unix invariant that an ExitStatus with no exit code was terminated by a
signal. That does not always hold: an ExitStatus reconstructed for a
distributed compile (or an abnormal wait status such as WIFSTOPPED) can
report neither a code nor a signal. When that happened the expect() panicked
the compile task, which the server surfaced as a misleading "Failed to bind
socket" and, under load, repeatedly fell back to local compilation.
Return Option<i32> from get_signal and assign it straight into res.signal, so
a compile that reports neither code nor signal leaves res.signal unset
instead of crashing the in-flight task. The Windows arm returns None rather
than panicking; ExitStatus::code() is always Some there, so the signal branch
is never reached anyway.
Add a unit test covering a real terminating signal (SIGKILL) and the
neither-code-nor-signal case (WIFSTOPPED via from_raw), which previously
panicked.
Signed-off-by: Javier Tia <javier@peridio.com>
40e2f96 to
210bc7c
Compare
Part of #2775 (splitting the OpenEmbedded/Yocto sccache-dist work into focused
PRs; replaces the closed #2750).
Rebased onto current
main(dac6c80); the branch is still the single commit.Problem
get_signaldidstatus.signal().expect("must have signal"), assuming the Unixinvariant that an
ExitStatuswith no exit code was terminated by a signal. Thatdoes not always hold: an
ExitStatusreconstructed for a distributed compile (oran abnormal wait status such as
WIFSTOPPED) can report neither a code nor asignal. When that happened the
expect()panicked the compile task, which theserver surfaced as a misleading "Failed to bind socket" and, under load,
repeatedly fell back to local compilation. Found under a Yocto/BitBake host-mode
distributed build.
Approach
Return
Option<i32>fromget_signaland assign it straight intores.signal,so a compile that reports neither code nor signal leaves
res.signalunsetinstead of crashing the in-flight task. The Windows arm returns
Noneratherthan panicking;
ExitStatus::code()is alwaysSomethere, so the signal branchis never reached anyway.
Test
Adds a unit test covering a real terminating signal (SIGKILL) and the
neither-code-nor-signal case (
WIFSTOPPEDviafrom_raw), which previouslypanicked. On the rebased branch the format check, the build, the unit tests and the
Docker-based dist tests all pass.
Evidence
The unit test reproduces the neither-code-nor-signal state directly and panics on
the old code. I have no separate benchmark for this change alone: it ships in the
wave-1 build described on #2777, which completed 25,156 distributed compiles.