Repository navigation
fix(s3): stop the acceleration recovery test's precondition racing its own backoff - #519
Merged
scttfrdmn merged 1 commit intoSep 17, 2026
Conversation
…s own backoff main is red. TestTheAccelerateEndpointComesBackWithinTheBackoff failed its vacuity guard — "acceleration is still active, so nothing was withdrawn and this test cannot observe a recovery" — and that diagnosis was wrong. The withdrawal did happen; the log line immediately above the failure is "Retrying S3 Transfer Acceleration after backoff backoff=25ms". The 25ms backoff had already expired by the time the guard looked. So the guard conflated two states it cannot tell apart: never withdrawn, and withdrawn and already recovered. Reading Active is also what performs the open→half-open transition that sets it back to true — TestAccelerationStatsDoesNotReportAStateItJust- Changed asserts that exact mechanism from the other side — so under load the guard could cause the recovery it exists to rule out, then blame the gate for a fault that was the clock's. The fix is to assert on something monotonic. Fallbacks counts exactly this withdrawal and only ever counts up, so no amount of elapsed time can make it lie in either direction. Verified by mutation: dropping the injected fault leaves the guard firing with the right message, so it still catches the vacuous run it exists for. 20 runs under -race with the sibling acceleration test alongside it, clean. Only this one assertion needed it. The file's four other Active reads are safe on purpose: three are in tests configuring a one-hour retry, where the gate cannot reopen underneath them, and the fourth deliberately sleeps 2*retry and asserts the post-transition state. Exposed rather than caused by #516: that PR added ~1000 lines of parallel test to this package, and the extra load is what made a 25ms window get missed. The same load made the #515 race deterministic in the same job. No CHANGELOG entry — this is a test precondition, with no user-facing behaviour attached.
scttfrdmn
deleted the
fix/acceleration-recovery-precondition-races-the-backoff
branch
September 20, 2026 05:25
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.
mainis red. Thetestjob ondc69e64failed like this:The diagnosis in that message is wrong, which is the interesting part. Something was
withdrawn. The log line immediately above the failure is:
The withdrawal happened, and the 25ms backoff had already expired by the time the guard
looked. The guard conflated two states
Activecannot distinguish: never withdrawn, andwithdrawn and already recovered.
It is worse than a plain timing window, too. Reading the gate is what performs the
open→half-open transition that sets
Activeback to true —TestAccelerationStatsDoesNot- ReportAStateItJustChangedin the same file asserts that exact mechanism from the otherside. So under load this guard could cause the recovery it exists to rule out, and then
blame the gate for a fault that belonged to the clock.
The fix
Assert on something monotonic.
Fallbacksis incremented on exactly the withdrawal path(
executeWithAccelerationFallback→RecordFallbackEvent) and only ever counts up, so noamount of elapsed time can make it lie in either direction:
Verified by mutation, because a vacuity guard that no longer fires is worse than no
guard: dropping the injected fault so nothing is ever withdrawn leaves the test failing with
no fallback was recorded, at the guard. It still catches the vacuous run it exists for. 20runs under
-racealongside the sibling acceleration test, clean.Only this one assertion needed it
The file's four other
Activereads are safe on purpose, and I checked each rather thanchanging them all:
AccelerationRetrytime.HourStateClosed2*retryand asserts the post-transition statetime.HourI also added the rule to the test's doc comment rather than leaving two separate fixes: in
this test no assertion may read an instantaneous acceleration state, because the entire point
of a 25ms retry is that every such state changes on its own within 25ms.
Provenance
Exposed rather than caused by #516. That PR added ~1000 lines of parallel test to this
package, and the extra load is what makes a 25ms window get missed — the same load that made
the #515 data race deterministic in the same job, having been about one run in twenty locally.
Neither is a defect in the seekable read path; both are pre-existing timing assumptions that
only held while the package was lighter.
No CHANGELOG entry: this is a test precondition with no user-facing behaviour attached.