Repository navigation
Fix double retry loop with no backoff - #88
Merged
Merged
Conversation
RunTest already retries failed requests in a loop, but SendHTTPRequest also wrapped the request in a go-retryablehttp client configured with the same retry count and callback. Every outer-loop attempt triggered its own inner retry cycle, multiplying request volume, and since the client was a bare struct literal (never NewClient()), RetryWaitMin and RetryWaitMax defaulted to zero, so retries fired back-to-back with no delay. Worse, go-retryablehttp's Do() discards the actual http.Response and returns only a generic giving-up error once its internal retries exhaust, even for a request that got a real (non-matching) response. That's why failures across services using this tool showed an opaque "giving up" error instead of the real status code or body. Drop the inner retry client entirely, make SendHTTPRequest a single plain http.Client call, and let RunTest's existing loop own all retry logic with an actual backoff between attempts. Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The lint workflow used go-version: stable, which now resolves to 1.27.x. golangci-lint v2.8.0's binary is built with Go 1.25 and panics when asked to type-check source declaring a newer go directive than its own toolchain (file requires newer Go version go1.27, application built with go1.25). Use go-version-file so lint runs on the same Go version the module actually targets, matching the pattern already used in action.yml. Co-Authored-By: Claude <noreply@anthropic.com>
The delay between retry attempts was hardcoded to 2 seconds. Repos with many tests and frequent retries want control over how much that adds to CI time, so expose it as RETRY_BACKOFF_SECONDS / a retry-backoff-seconds action input, defaulting to the previous hardcoded value of 2 seconds when unset. Co-Authored-By: Claude <noreply@anthropic.com>
unladenSwallow
marked this pull request as ready for review
September 22, 2026 17:24
unladenSwallow
requested review from
Aravind3515,
BobbyBonaguraNYT and
stephenhetterich
and removed request for
a team
September 22, 2026 17:24
grantwheeler-nyt
approved these changes
Sep 22, 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.
Note
🤖 Generated with Claude Code
Summary
RunTestalready retries a failing test in its own loop, butSendHTTPRequestalso wrapped the request in ago-retryablehttpclient configured with the same retry count/callback — every outer-loop attempt triggered its own inner retry cycle, multiplying request volume.retryablehttp.Clientwas constructed as a bare struct literal (never viaNewClient()), soRetryWaitMin/RetryWaitMaxdefaulted to zero — retries fired back-to-back with no delay.go-retryablehttp'sDo()discards the actual*http.Responseand returns only a generic"... giving up after N attempt(s)"error, even when the request got a real (just non-matching) response — masking the true status code/body from test output across every repo using this tool.Changes
go-retryablehttpclient fromSendHTTPRequest; it now issues a single plainhttp.Clientrequest.RunTest's existing retry loop is now the sole retry mechanism, with an actual 2s backoff between attempts.github.com/hashicorp/go-retryablehttpdependency (go mod tidy).Test plan
go build ./...go vet ./...go test ./...Ran tests in dev service. Link available to internal users by request.