Repository navigation
fix(mcpx/cache): Scan skips beside-file leases so Prune can never delete a live lease (#3112) - #3728
Conversation
…ete a live lease (#3112)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bcc05ae15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ex P1 on #3728, #3112) Table cases distinguishing the sibling-aware classifier from an unconditional .lease- substring filter: infix name with no sibling stays an entry; infix name with a directory sibling stays an entry (directory leases live inside); a non-nil match that accepts the lease name but excludes its sibling still skips the lease (recognition precedes match); a directory entry with an inside lease scans once with Leased=true. go test ./internal/cache ./internal/runner -count=1 PASS (also after merging current main).
|
@codex review Fix round for the Codex P1 (lease-classifier permutation coverage) is in head 07c1801, thread replied to and resolved. Note on CI: the basic:lint and stress failures on this PR are the pre-existing pkgs/mcpx internal/conformance test-package compile break (failingReads vs mcpserver.Backend Complete, features_test.go:308), verified in this run's CI logs and proven on clean main by earlier shifts — internal/cache is untouched by it; cache + runner suites pass on the laptop. Requesting re-review of 07c1801. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #3112. Queue task 5637.
Problem
internal/cache.Scanonly skipped names starting with the bare.lease-prefix, but a lease for a single-file entry lives beside it as<entry>.lease-<random>(leaseLocation). A nil-matchscan (Cache.List, the runner'spruneWorkDirs) therefore returned the lease file as an entry withLeased: false— corrupting eviction accounting and lettingPrune/Evictselect the lease file itself as a victim and delete the pin from a live, in-use entry (the #2566 finding-3 failure, through the lease file rather than the entry).Fix
Scancollects the listing up front and skips a non-directory name when it is a beside-file lease: the name before a.lease-infix is a file in the same listing (isBesideLease). Recognition is independent ofmatch(including nil), so a victim list containing a lease file is now impossible rather than rechecked. A genuine entry whose name merely contains the infix, with no such sibling, stays an entry; directory-entry leases (inside the entry) and the #2566 protections are untouched.Tests
TestScanSkipsBesideFileLease— a leased file entry scans as exactly one entry withLeased: trueunder a nil match; no lease-named entry is returned.TestPruneNeverRemovesBesideFileLease— the probe shape (lease aged oldest,Prune(MaxEntries: 1)): nothing is removed, the lease file and the entry survive, and the entry stays leased.go test ./internal/cache -count=1— ok;go test ./internal/runner -count=1— ok (laptop).Need help on this PR? Tag
@codesmith-botwith what you need.