Repository navigation
fix: compute clock skew from the time response headers are received - #3484
Merged
Merged
Conversation
sichanyoo
approved these changes
Nov 3, 2026
boblodgett
self-requested a review
November 3, 2026 19:35
boblodgett
approved these changes
Nov 3, 2026
jterapin
requested review from
boblodgett and
sichanyoo
and removed request for
peterrsongg
November 3, 2026 23:35
boblodgett
approved these changes
Nov 4, 2026
dscpinheiro
approved these changes
Nov 4, 2026
sichanyoo
approved these changes
Nov 4, 2026
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.
Description
Compute the clock skew candidate as the response
Dateminus the client time when the response headers were received, instead of the request round-trip midpoint.Dateis generated with the response, so the midpoint counted half of the server processing time as skew (e.g. about +310s for a 620s request with agreeing clocks).Fix
on_headerslistener (added once per request,cleared each attemptwith its recorded timestamp cleared before each retry) records the raw client time when headers arrive, before the body is read. Used by bothHandlerandLegacyHandlerthrough a shared helper onRetryErrors.server_time - received_at. The 15-minute discard, 4-minute retry threshold,Age/missingDatediscards, per-endpoint storage, and disable settings are unchanged.signal_headers), the candidate falls back toserver_time - now. Net::HTTP, HTTP/2, andstub_responsesall record it.3.264.0.Testing
aws-sdk-corespecs:2515 examples, 0 failures (30 added)2,491 examples, 0 failures, 36 pending.Shared clock skew test cases (12) run through an STS client with a fake clock, plus a loopback Net::HTTP test that holds the body after sending headers (200 and 403).changelog_verifier_specpasses;git diff --checkclean.🤖 Edited by @jterapin with AI assistance. ✨