Repository navigation
fix: retry GitHub release downloads on HTTP 618 - #640
Conversation
Merging this PR will not alter performance2 warnings
Comparing Footnotes
|
[Medium impact] The latest change appears safe to merge. SummaryAdds retries for GitHub release downloads, checks pinned hashes, and improves failure messages.
Reviews (2) · Last reviewed commit: "fixup! fix(go): retry the go-runner inst..." · Reviewed by Greptile |
|
@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
a4f8032 to
b3e7b02
Compare
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).
.deb:download_pinned_filealready 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.shdownloaded the installer once, and the installer downloads the archive with a singlecurl.go.shnow retries the whole install.curl(installer: add retry for transient network errors axodotdev/cargo-dist#2311). The release workflow now adds--retry 5 --retry-all-errorsto it, andallow-dirty = ["ci"]keepsdist generatefrom overwriting that step.--retry-all-errorsneeds 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:
The long-term fix is to serve releases from our own CDN (COD-4523).
Verification
retries_any_error_status_and_recoversanswers 618, then 404, then the file.go.shinstalled after an expired installer link and then an expired archive link. Six expired archive links failed after 31 s.Refs COD-4520