Repository navigation
Re-sign each retry [RHELDST-47596, RHELDST-47601] - #40
Open
crungehottman wants to merge 1 commit into
Open
crungehottman wants to merge 1 commit into
crungehottman wants to merge 1 commit into
Conversation
Retries were performed by urllib3's Retry on the HTTPAdapter, which resends the request below the requests auth layer -- so EdgeGridAuth signed once and every retry reused the same Authorization header. Once a request's signature aged past Akamai's ~30s timestamp tolerance, every retry was rejected with 400 "Invalid timestamp", regardless of whether the original rate limiting had cleared, until the retry budget was exhausted and the commit failed. Replace the transport-level retry with an application-level retry loop in __start_purge: each attempt re-issues session.post(), so EdgeGridAuth re-signs with a current timestamp and a retry can succeed once the rate limit clears. - compute_backoff() mirrors urllib3's exponential backoff (first retry 0, then factor*2**(n-1) + jitter, capped), so the FAST_PURGE_RETRY_* tunables keep their meaning. - Retryable statuses are an explicit allowlist (anything else fails fast), configurable via FAST_PURGE_RETRY_STATUSES. The default covers 429, all 5xx, and the EdgeGrid-specific 400 (returned for a stale timestamp and for WAF rate-control, both of which recover on a fresh attempt). - Connection/timeout errors are retried. - Failed attempts now log the response body and Retry-After, so the actual Akamai error (e.g. "Invalid timestamp") is visible. - A non-JSON 201 is tolerated rather than raising. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #40 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 152 174 +22
=========================================
+ Hits 152 174 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
negillett
approved these changes
Nov 12, 2026
This branch has not been deployed
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.
Retries were performed by urllib3's Retry on the HTTPAdapter, which resends the request below the requests auth layer -- so EdgeGridAuth signed once and every retry reused the same Authorization header. Once a request's signature aged past Akamai's ~30s timestamp tolerance, every retry was rejected with 400 "Invalid timestamp", regardless of whether the original rate limiting had cleared, until the retry budget was exhausted and the commit failed.
Replace the transport-level retry with an application-level retry loop in __start_purge: each attempt re-issues session.post(), so EdgeGridAuth re-signs with a current timestamp and a retry can succeed once the rate limit clears.