Repository navigation
fileservice: preserve ENOMEM from disk cache reads - #33162
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request is merged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: b1c00d1b984664a1b1f18581a1c0c04cb5fefa73
Assessment: approve
Disk-cache reads now return wrapped ENOMEM before attempting an origin read. Ordinary short cache reads still fall back to storage. Error cleanup releases vector-owned buffers from completed entries and clears their aliases so the vector can be retried safely.
Model: gpt-6.2-sol / xhigh
Session: 01a20d47-b35e-7bd2-9d5c-61978a866730 · slot 0 · generation 6
Validation:
-
All 11 focused fileservice tests passed in normal and race modes. The active-download pin test passed 100 race-enabled repetitions.
-
The normal fileservice package passed with two tests that leave a shared cache deadline set excluded. The resulting duplicate origin read reproduced on both the merge base and the PR. The merge-base download test passed three times in isolation.
-
Verified the frozen diff and matched the check commands, source fingerprints, exit receipts, and retained logs in validation-reconciliation.json. Recorded all discussion dispositions in discussion-assessment.json.
Limitations:
-
The unfiltered normal and race runs hit the preexisting download test failure and then timed out. The full race suite has no passing result.
-
Validation covered the main-branch fix with injected allocation failures. The 4.2-dev fix and the original CN mapping-exhaustion incident were outside this review.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #33095 (the issue remains open for the 4.2-dev fix and incident tracking).
What this PR does / why we need it:
After the main read-buffer fix, DiskCache.Read still treated ENOMEM as a recoverable cache miss. It could then fall back to object storage and attempt another allocation. This change returns ENOMEM from the existing cache-read error boundary while preserving fallback for ordinary cache errors such as a truncated cache file.
If a multi-entry cache read succeeds for an earlier entry and then fails with ENOMEM, error cleanup now clears aliases to the released, vector-owned buffer before retry. It preserves caller-owned buffers and unfinished entries.
The added disk-backed tests cover range and full-file cache hits, wrapped ENOMEM, no object-store fallback on allocation failure, retry with the same vector, ordinary short-read fallback, partial-hit cleanup, and reader-pin release from an active download generation.
Validation
Related 4.2-dev PR: #33131.