Skip to content

Conversation

@nicholasbishop
Copy link
Member

If the download fails, retry up to four times. The first retry will happen after a one-second delay. Each subsequent retry doubles the delay.

Fixes #244

Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This should help with spurious 504 Gateway Timeouts in GitHub-hosted runners.

I noticed two things:

  1. This retries on all errors, not just transient errors.

    Transient error means either: a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502, 503, 504, 522 or 524 response code.

    From Curl --retry

    Non-transient errors, such as 404 Not Found, don't benefit from being retried. Retrying non-transient errors only wastes a bit of time, though, and differentiating may not be worth the effort.

  2. This does not respect the HTTP Retry-After response header.

    Supporting that header is probably also not worth the effort, though.

The reqwest::retry could help with those goals, but that would also take longer to compile.

So this PR looks good to me and will solve the spurious CI failures. Thanks again! :)

If the download fails, retry up to four times. The first retry will
happen after a one-second delay. Each subsequent retry doubles the
delay.
@nicholasbishop nicholasbishop enabled auto-merge (rebase) January 1, 2026 17:37
@nicholasbishop nicholasbishop merged commit 9fdac86 into main Jan 1, 2026
1 check passed
@nicholasbishop nicholasbishop deleted the bishop-retry-download branch January 1, 2026 17:38
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.

Retrying would be useful

3 participants