Repository navigation
cargo-target-broker: keep the row when eviction fails - #11424
Merged
Merged
Conversation
evict_until_under_cap removed the victim with ignore_errors=True and then always deleted its DB row, so a dir that could not be removed stayed on disk but stopped counting against the cap, and adopt_strays could pick it up again. Now a failed or partial removal keeps the row, re-measures what is left, counts an eviction_failure, and skips that dir for the rest of the pass. Adds the broker's first test suite, a nightly workflow and its registry entry. Fixes #11417 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dezren39
marked this pull request as ready for review
November 17, 2026 22:16
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Codex Review Summary: ✅ CompletedThis 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11417
Before:
When the cargo target broker evicted an idle dir to get under its size cap, it removed the dir with
ignore_errors=Trueand then always deleted its registry row. If removal failed (permissions, filesystem error), the dir stayed on disk but no longer counted against the cap, so the pool could grow past the cap indefinitely, andadopt_strayscould re-register the orphan and repeat the cycle.After:
A failed or partial removal keeps the row and re-measures the bytes still on disk, bumps a new
eviction_failurescounter (shown bystatus), logs the error, and skips that dir for the rest of the pass so the loop cannot spin on it. A clean removal behaves as before.How:
shutil.rmtreenow raises; the code checks whether the path still exists before touching the row.Testing:
New
infra/cargo-target-broker/tests/test_cargo_target_broker.py(4 tests: clean eviction, failed removal, partial removal, no re-adoption). All pass; 3 of them error on the old code. Addedcargo-target-broker-tests.yml(nightly plus dispatch, matching the CI policy) and its registry entry.check-ci-policy-agreement.shOK;check-suite-registry.shshows the same 33 pre-existing failures as main and none for this suite.Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.