Retry transient failures when downloading artifacts - #585
Draft
dan-manges wants to merge 2 commits into
Draft
Conversation
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…wnload # Conflicts: # internal/api/client_test.go
kylekthompson
marked this pull request as draft
August 5, 2026 15:55
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.
rwx artifacts downloadmade a single unretried request to storage, so a connection reset partway through surfaced as a hard failure:DownloadArtifactnow retries with bounded exponential backoff, following the same shape asListRuns: adownloadArtifactOncehelper returns aretryableflag, and the caller loops onretry.NewBackoff()(5 attempts, 1s→5s, ~12s worst case).Retried:
retry.IsTransient— resets, refused, timeouts, EOF429and5xxfrom storage (S3SlowDown)Not retried:
400/403/404, so an expired presigned URL or missing key still surfaces immediately. The same presigned URL is reused across the short retry window.Exhausted retries are wrapped with
errors.ErrNetworkTransient, matchingretry.RoundTripper, so telemetry buckets them asnetwork_transient_errorrather thanunknown.This also covers the parallel multi-artifact download path in
service_artifacts.go, which goes through the same client method. Retries are silent under the existing "Downloading artifact..." spinner.Still buffered, no resume
Artifacts are read fully into memory and a retry restarts from byte zero — there's no
Range-based resume. A reset late in a multi-GB download still re-transfers the whole thing..rwx/sandbox.yml
Added, since the repo had no sandbox config. It mirrors
ci.yml(code→tool-versions→go/go-deps, plus thelsp-*chain sointernal/lsp's embedded bundle exists) with asandboxtask runningrwx-sandbox.Verification
rwx sandbox exec -- go test ./internal/... ./cmd/...— all packages passgolangci-lint run ./internal/api/...— 0 issuesTestAPIClient_DownloadArtifact_Retriescovers reset-then-success, exhaustion after 5 attempts with the transient sentinel, 503-then-success, and 403 not retried. Resets are simulated by hijacking the connection withSetLinger(0).🤖 Generated with Claude Code