Repository navigation
Expose remote cache read errors and fail on server disconnects - #2779
seungpyoson wants to merge 11 commits into
Conversation
e14c22c to
5abf492
Compare
5abf492 to
83b66fd
Compare
83b66fd to
a35fe90
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2779 +/- ##
==========================================
+ Coverage 70.91% 73.21% +2.30%
==========================================
Files 72 72
Lines 37684 37695 +11
==========================================
+ Hits 26723 27600 +877
+ Misses 10961 10095 -866 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
Comparing Footnotes
|
|
Synced this PR with current main at 918b8ef. New CI, integration-test, and benchmark workflows are waiting for maintainer approval. Could a maintainer please approve the workflows and re-review the PR after they complete? The sync includes main's libc pin for the prior dist-test failure and allows CodSpeed to compare against the current runner generation. |
|
@sylvestre Could you take a look at sccache PR #2779 (#2779) when you have a chance? I synced it with current main today. The underlying bugs are still present, the patch merges cleanly, and the fork workflow runs are waiting for maintainer approval. If the approach looks good, could you approve the workflows and merge it? |
|
Quick update: the sole non-successful check on d048ff9 was the CUDA 11.8 job, which was canceled after Ubuntu package mirror requests stalled during NVCC installation; it never reached tests. I pushed empty commit acfbdca to retrigger the workflows without source changes. The new CI, integration-test, and benchmark runs are waiting for maintainer approval. |
|
@sylvestre a gentle reminder for your review |
|
@sylvestre @Xuanwo Small fail-closed fix, +84/−39, CI green, rebased on main — happy to split or adjust if anything blocks review. |
Resolve conflicts with mozilla/sccache main (c2a187d): - src/cache/cache.rs: the fail-closed decode now backs get_with_raw (mozilla#2835) and uses the any_cache_remote cfg alias (mozilla#2905); the test follows. - src/commands.rs: keep the ArtifactNotification loop (mozilla#2875); the read error arm collapses to the SCCACHE_IGNORE_SERVER_IO_ERROR check. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VNNohpFLCBvQm2aB5ZHtA
|
Superseded by #2928, which carries only the remote read error fix. The server-disconnect change will be proposed separately. |
Summary
NotFoundremote read failures through the existing cache-error statistics path (MissType::CacheReadError, "Cache errors") instead of counting them as ordinary missesCompileStartedresponse I/O failures follow the documented default-fatal policy (README: "By default, sccache will fail your build if it fails to successfully communicate with its associated server") while preservingSCCACHE_IGNORE_SERVER_IO_ERROR=1Related: #2415 (the "read failures are invisible" part; the token-refresh and skip-write parts of that issue are not addressed here).
Why these are the odd ones out
RemoteStorage::get_rawalready returns an error for every non-NotFoundbackend failure ("Return error instead of silently returning None"). Only the parsed read used by the daemon path still turned the same failures into a miss.CompileFinished(compile_direct). Only the daemon-mode client still compiled locally on an unexpected EOF, contrary to the README default.After this change both read paths and both client modes behave the same way.
Deliberately unchanged
Scope
The change touches
src/cache/cache.rsandsrc/commands.rsonly, squash-ready. There are no documentation, protocol, cache-format, dependency, disk-cache, multi-level-cache, or client-side-storage changes. Existing documentation already describes the server-I/O policy.Synced with
mainat c2a187d (2026-10-22): the decode helper now backsget_with_raw(#2835), uses theany_cache_remotecfg alias (#2905), and theArtifactNotificationloop (#2875) is kept as is; only its error arm changed.Validation
Focused regression tests cover unexpected direct remote read errors, default-fatal post-start disconnects, and the existing opt-in local fallback. On the merged head the three tests pass locally (
cargo test --lib -- remote_storage test_handle_compile_response_disconnect),cargo fmt --checkis clean, and clippy reports nothing in the touched files. Upstream CI and maintainer review remain required before merge; the fork workflow runs need maintainer approval.