Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev/chao/codex/pr25172-replay-headroom #25172 +/- ##
==========================================================================
- Coverage 82.02% 81.94% -0.08%
==========================================================================
Files 1136 1136
Lines 439539 429614 -9925
Branches 439539 429614 -9925
==========================================================================
- Hits 360522 352067 -8455
+ Misses 58242 56491 -1751
- Partials 20775 21056 +281 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sunchao
force-pushed
the
codex/upstream-consumer-accounting
branch
from
September 16, 2026 16:16
9480bfa to
b075256
Compare
sunchao
changed the base branch from
main
to
dev/chao/codex/pr25172-replay-headroom
September 16, 2026 16:17
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.
Which issue does this PR close?
Fixes FairSpillPool admission for sibling reservations and an already-full pool. Depends on #25383; this draft is based on that PR's branch so its diff contains only accounting enforcement and its tests. Merge the prerequisite first, then rebase and retarget this PR to main.
Rationale for this change
An operator with a 100 MiB allowance can hold 60 MiB in one reservation and 40 MiB in another. Checking an empty sibling alone incorrectly permits further allocation. Similarly, registering another consumer does not create free memory when the pool is already full.
What changes are included in this PR?
FairSpillPool tracks combined usage by consumer ID and admits fallible growth only when both the consumer's fair share and the pool's remaining capacity permit it. Splitting, transferring, and dropping reservations preserve that accounting. The consumer map also supplies the consumer count, avoiding a redundant counter.
The existing permanent-pressure regression now requires a bounded resource error and cleanup once a competing operator takes the remaining memory.
What is the testing strategy for this PR?
Six focused pool regressions cover sibling totals, fair shares, split/take/drop, a newly registered consumer against an exhausted pool, infallible-growth accounting, and integer overflow. The aggregate pressure test checks exhaustion after output has begun, peak reservation bounds, and memory/disk release.
Validated on top of #25383:
cargo fmt --all, strict all-target/all-feature Clippy, and the full./dev/rust_lint.shpassed.Local validation uses Rust 1.98.1 and upstream revision
22651d24with its unchanged dependency lockfile; newer main's dependency versions are unavailable in the local registry. The prerequisite merges cleanly with current main. After it merges, rebase this accounting change and rerun CI against main.Are there any user-facing changes?
Requests through try_grow are rejected when combined reservations exceed the consumer allowance or the pool is full. Infallible grow keeps its existing contract. No public API is added.