Skip to content

fix: retry GitHub release downloads on HTTP 618 - #640

Merged
fargito merged 3 commits into
mainfrom
cod-4136-retry-github-release-asset-downloads-when
Dec 1, 2026
Merged

fargito merged 3 commits into
mainfrom
cod-4136-retry-github-release-asset-downloads-when

Conversation

@fargito

@fargito fargito commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

GitHub Releases sometimes answers HTTP 618: github.com serves a cached redirect to a signed link that has already expired, and a new request to the release URL gets a fresh one (root cause).

  • valgrind .deb: download_pinned_file already retried resets and 5xx, but failed at once on 618 (Failed to download file: 618 <unknown status code> on Ruff). It now retries any error status.
  • go-runner: go.sh downloaded the installer once, and the installer downloads the archive with a single curl. go.sh now retries the whole install.
  • CLI installer: cargo-dist's installer downloads the archive with a single curl (installer: add retry for transient network errors axodotdev/cargo-dist#2311). The release workflow now adds --retry 5 --retry-all-errors to it, and allow-dirty = ["ci"] keeps dist generate from overwriting that step. --retry-all-errors needs curl 7.71 (2020): no CodSpeed upload in the last 28 days came from an older system.

Each makes 6 attempts with exponential backoff. When they all fail, the error says where the file is hosted:

Failed to download https://github.com/CodSpeedHQ/valgrind-codspeed/releases/download/3.26.0-0codspeed14/valgrind_3.26.0-0codspeed14_ubuntu-24.04_amd64.deb after 6 attempts: HTTP 618 <unknown status code>.
This file is hosted on GitHub Releases. Re-run the job, and check https://www.githubstatus.com if it keeps failing.

The long-term fix is to serve releases from our own CDN (COD-4523).

Verification

  • retries_any_error_status_and_recovers answers 618, then 404, then the file.
  • Against a local fake of GitHub, go.sh installed after an expired installer link and then an expired archive link. Six expired archive links failed after 31 s.
  • The 5.8.0 installer, patched the same way, recovered from an expired link, a 504, a reset and a truncated archive in a row.

Refs COD-4520

@codspeed

codspeed Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 8 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 53 untouched benchmarks
⏩ 6 skipped benchmarks1


Comparing cod-4136-retry-github-release-asset-downloads-when (b3e7b02) with main (cfe4ea1)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The latest change appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest change appears safe to merge.

Summary

Adds retries for GitHub release downloads, checks pinned hashes, and improves failure messages.

  • Pinned downloads retry server and file-check failures before giving up.
  • The Go runner installer retries failed downloads before it runs them.
  • New CLI installers retry when their release archive download fails.

Reviews (2) · Last reviewed commit: "fixup! fix(go): retry the go-runner inst..." · Reviewed by Greptile

@fargito fargito closed this Dec 1, 2026
@fargito fargito reopened this Dec 1, 2026
@fargito fargito changed the title fix: retry GitHub release downloads on any server error fix: retry GitHub release downloads on any failure Dec 1, 2026
@fargito fargito changed the title fix: retry GitHub release downloads on any failure fix: retry GitHub release downloads on HTTP 618 Dec 1, 2026

fargito commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

@adriencaccia updated

GitHub Releases can redirect to a signed link that has already expired, and that link answers
HTTP 618. reqwest-retry treats a status it does not know as fatal, so the download failed at once
with "Failed to download file: 618 <unknown status code>", without naming the file.

Retry any error status, each attempt starting again from the original URL so GitHub issues a
fresh link. Once the retries run out, the error names the URL and, for files on github.com, says
they are hosted on GitHub Releases.

Refs COD-4520
The go-runner installer came from GitHub Releases in a single curl call, and it downloads the
go-runner archive with a single curl call too, so one expired link (HTTP 618), 5xx or reset failed
the benchmarks. Retry downloading and running the installer up to 6 times with exponential
backoff; a hash mismatch still stops at once. Once the retries run out, the error says the
go-runner is hosted on GitHub Releases.

Refs COD-4520
The cargo-dist installer downloads the CLI archive from GitHub Releases with a single
`curl -sSfL`. GitHub can answer it with HTTP 618 for an expired signed link, which plain
`--retry` does not retry, so one such answer fails the install.

The release build now adds `--retry 5 --retry-all-errors` to that call, and fails if the
template's download line changes. Each retry starts again at github.com, which issues a fresh
link. `--retry-all-errors` needs curl 7.71: no upload in the last 28 days came from a system with
an older curl.

dist does not let us change the installer, so release.yml is now edited by hand and
`allow-dirty` keeps `dist generate` from overwriting it.

Refs COD-4520
@fargito
fargito force-pushed the cod-4136-retry-github-release-asset-downloads-when branch from a4f8032 to b3e7b02 Compare December 1, 2026 15:22
@fargito
fargito merged commit b3e7b02 into main Dec 1, 2026
67 checks passed
@fargito
fargito deleted the cod-4136-retry-github-release-asset-downloads-when branch December 1, 2026 15:39
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.

2 participants