fix(runner): prevent Retry-After duration overflow - #58
Merged
Merged
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
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.
Large numeric Hugging Face
Retry-Aftervalues overflowed Go’s nanosecond duration. WithRetry-After: 9223372037, the client retried immediately and exhausted all six attempts instead of waiting for the server cooldown or cancellation.Parse unsigned seconds and saturate at Go’s maximum duration before multiplication. Preserve ordinary numeric and HTTP-date cooldowns, context cancellation, and fallback behavior for malformed headers, including oversized numbers followed by junk. This addresses an overflow defect without introducing the premature-retry policy proposed in #50.
Regression proof uses a real local HTTP server: main returns HTTP 429 immediately for the overflowing header; the fix makes exactly one request and exits at the caller’s deadline. Boundary tests cover zero, a normal one-hour cooldown, both sides of the duration limit, values beyond uint64, negative values, malformed values, and HTTP dates. The focused tests were observed failing before the fix and passing afterward. Full Go tests, vet, and docs generation are required on AWS Crabbox before merge, alongside independent Codex review through P2 and exact-head CI.
Final validation passed on Go 1.27.1/Linux:
go test -count=1 ./...,go vet ./..., andmake docs-siteon AWS Crabbox. Independent review is clean through P2 for the final diff, including malformed oversized headers.