Repository navigation
cache: preserve and count lookup read errors - #2967
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2967 +/- ##
==========================================
+ Coverage 79.69% 79.80% +0.10%
==========================================
Files 75 76 +1
Lines 46614 46854 +240
==========================================
+ Hits 37149 37391 +242
+ Misses 9465 9463 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| compilation increments `Cache read errors` as well as the existing `Cache errors` | ||
| and `Cache misses` counters. Ordinary misses do not increment the read-error | ||
| counter, and overall lookup timeouts are recorded separately as `Cache timeouts`. | ||
| Errors handled inside a multilevel tier walk are not aggregate lookup errors. |
There was a problem hiding this comment.
i didn't understand this line, could you please clarify or drop it? :)
There was a problem hiding this comment.
Reworded in 804433b let me know what you think
|
I also found another error-to-miss issue in disk path lookup - 47010f9 |
|
Upon further inspection, I've noticed that an older client can interpret Would an explicit fail be preferred here? Precedent was not clear to me in previous breaking changes. |
cba732f to
8fe6532
Compare
|
hi @sylvestre , I have rebased this PR along with #2966 and #2965 , if you had some time to approve the CI runs & re-review it would be much appreciated 🙂 |
Changing the payload of an existing bincode variant can let an older client decode an error as a miss. Keep the path and raw success replies unchanged and append a distinct StorageReadError variant instead. Keep the backend cause in the daemon log as well as in the reply. The compile path counts lookup errors; a tier that fails during fallback is not itself an aggregate read error.
A backend without a local path returns archive bytes over IPC. If those bytes are corrupt, the ZIP error explains what went wrong but does not identify the entry to inspect. Attach the lookup key only on decode failure. The IPC regression test checks that the diagnostic names the key and retains the ZIP cause.
8fe6532 to
516dc50
Compare
Derived equality checks the path on a hit and distinguishes a miss from an unsupported lookup. Use it for both decoding directions; the serialized bytes and the compatibility cases stay unchanged.
After the upstream storage trait split, get() on a concrete IpcStorage requires CacheStorage in scope. Import it in the server tests so both raw and disk-path lookup cases compile on the merged branch.
|
Thanks for your PR |
Rebased onto main at 0e8f184 (the mozilla#3007 CacheStorage/PreprocessorCacheStorage split + mozilla#2967's StorageReadError wire). BackoffStorage now implements CacheStorage (get_path returns Result<GetPathResult>) plus an empty PreprocessorCacheStorage forward - preprocessor entries are a local-disk concern, never a stalled-backend read the gate exists for - so Storage comes back via the blanket impl and the chain keeps wrapping Arc<dyn Storage>. The server's StorageGetRaw handler keeps the skip/timeout arms ahead of the new storage_read_error path: a skipped or timed-out lookup is reported to the client as an absent entry, never as a counted read error - a gate skip is not a failure the client should count. Test fixtures implement CacheStorage + the empty preprocessor impl; the cancelled-read test uses Waker::noop() (clippy 1.99's manual_noop_waker).
Fix two gaps in cache read-error reporting:
cache_read_errors.Keep existing hit/miss wire replies unchanged and report backend lookup failures through a separate error response. Older clients reject that response rather than decode it as a miss. Restart the daemon after updating to use the corrected error handling.