Repository navigation
fix(object_store): refund unstarted attempt credits and gate hedge outcomes - #240
Merged
Merged
Conversation
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThe PR refunds credits when a hedge or retry is dropped before its fetch starts. It also records hedge outcomes only after the hedge starts.
Reviews (1) · Last reviewed commit: "fix(object_store): refund unstarted atte..." · Reviewed by Greptile |
shikhar
force-pushed
the
fix/refund-unstarted-attempt-credits
branch
from
December 5, 2026 17:44
fff0e78 to
9587c11
Compare
shikhar
force-pushed
the
fix/refund-unstarted-attempt-credits
branch
from
December 5, 2026 19:41
9587c11 to
fa340e5
Compare
Merged
shikhar
pushed a commit
that referenced
this pull request
Dec 5, 2026
## 🤖 New release * `cachey`: 0.13.7 -> 0.13.8 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.13.8](0.13.7...0.13.8) - 2026-12-05 ### Fixed - *(service)* record single-chunk egress only when response body is polled ([#241](#241)) - *(object_store)* refund unstarted attempt credits and gate hedge outcomes ([#240](#240)) ### Other - *(deps)* upgrade dependencies ([#242](#242)) - drop nightly Cargo cooldown requirement and soften Cargo.lock guidance ([#237](#237)) - pin rust-dependency-cooldown workflow to commit SHA ([#236](#236)) - use shared rust-dependency-cooldown workflow ([#234](#234)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Summary
HedgePermitor newRetryPermit(AttemptBudget::try_retry() -> Option<RetryPermit>) started its attempt viastart(), refundingATTEMPT_COST(capped atMAX_CREDITS) onDropwhen unstarted.RetryPermit::dropskips locking once started.AttemptCredit::{Hedge(HedgePhase, HedgePermit), Retry(RetryPermit)}insideAttemptPermits, making hedge/retry mutual exclusion and pre-acquired admission explicit in the type system, and activate permits insideReplicaRequest::attempt'sfetchclosure so copies dropped before starting refund their credits.launched_hedgerecording withReplicaRequest::started_hedgeset inside thefetchclosure so unstarted hedges never reportDownloadOutput.hedgeor emit phantomcachey_hedges_total{outcome="lost"}increments.docs/replica-reads.mdto reflect unstarted credit refunds and started-hedge metric semantics.Verification
cargo +nightly fmtcargo clippy --locked --all-features --all-targets -- -D warnings --allow deprecatedcargo deny checkcargo nextest run --locked(unit test catching both missing refunds and missingMAX_CREDITScapping, plus deterministic paused-time tests verifying credit spend and refund for unpolled peer hedges, unpolled same-bucket hedges dropped byactive.retain, and unpolled overload rescues)Closes #238