Skip to content

Retry file transfers on transient network errors - #198

Open
aszady wants to merge 1 commit into
rmohr:mainfrom
aszady:retry.up
Open

Retry file transfers on transient network errors#198
aszady wants to merge 1 commit into
rmohr:mainfrom
aszady:retry.up

Conversation

@aszady

@aszady aszady commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Repository metadata files are susceptible to mid-transfer failures: the download might take long enough for the network infrastucture to time out or for other transient network issues to surface. These are inherently retriable – the server has the file, the connection just dropped.

fetchFile now wraps the transfer in a retry loop (up to 3 retries). Only genuinely transient errors trigger a retry.
HTTP status codes and Getter.Get failures are not retried at this layer – retryablehttp handles those internally, and by the time an error reaches fetchFile, those retries are already exhausted.

WriteToRepoDir error wrapping is changed from %v to %w so that errors.Is can see through to the underlying cause when classifying errors.

Repository metadata files are susceptible to mid-transfer failures: the download might take long enough for the network infrastucture to time out or for other transient network issues to surface.
These are inherently retriable – the server has the file, the connection just dropped.

`fetchFile` now wraps the transfer in a retry loop (up to 3 retries).
Only genuinely transient errors trigger a retry.
HTTP status codes and `Getter.Get` failures are not retried at this layer – `retryablehttp` handles those internally, and by the time an error reaches `fetchFile`, those retries are already exhausted.

`WriteToRepoDir` error wrapping is changed from `%v` to `%w` so that `errors.Is` can see through to the underlying cause when classifying errors.
@github-actions

Copy link
Copy Markdown

⚠️ Optional job e2e-bzlmod-toolchain-circular-dependencies failed ⚠️

  • exit status: 1

@aszady
aszady marked this pull request as ready for review June 25, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant