Make rust-cache sccache download network-resilient - #104
Merged
Conversation
Add retry and connect-timeout options to the curl that downloads the sccache binary. A single transient network failure previously failed the whole job; now curl retries up to 5 times (with backoff, including on connection refused and all transient errors) before giving up. https://claude.ai/code/session_014wByEsyJj7fxoBvgSP6dh6
There was a problem hiding this comment.
Pull request overview
This PR makes the rust-cache composite action more resilient to transient network failures when downloading the sccache release tarball from GitHub Releases by adding retry behavior and a connection timeout to the curl invocation.
Changes:
- Add
curlretry options (--retry,--retry-delay,--retry-connrefused,--retry-all-errors) for the sccache download. - Add a
curlconnection timeout (--connect-timeout 30) so initial connection attempts don’t hang as long.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mootz12
approved these changes
Jun 8, 2026
leighmcculloch
enabled auto-merge (squash)
June 8, 2026 15:34
leighmcculloch
added a commit
to stellar/stellar-cli
that referenced
this pull request
Jun 8, 2026
## What Make the `stellar/stellar-cli` install action resilient to transient network failures by adding retries to its two network-dependent steps: - **Binary download:** the `curl` call now retries up to 5 times with backoff (`--retry 5 --retry-delay 5 --retry-connrefused --retry-all-errors`), bounded by `--connect-timeout 30` and `--max-time 300`. The download now goes to a file (`$RUNNER_TEMP`) before being extracted by `tar`, rather than piping `curl` straight into `tar`, so that a retried transfer can safely restart without corrupting the tar stream. - **Attestation verification:** the `gh attestation verify` step, which also hits the network, is now wrapped in a retry loop (5 attempts with exponential backoff) before failing. ## Why A single transient network blip previously failed the whole job — for example [this rs-soroban-sdk run](https://github.com/stellar/rs-soroban-sdk/actions/runs/27120352954/job/80046147824) failed during the install step. With retries in place, a momentary failure is retried instead of failing the build. This mirrors the approach taken in [stellar/actions#104](stellar/actions#104), which added curl's built-in retry flags to harden a similar download path.
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.
What
Add retry and connection-timeout options to the curl invocation that downloads the sccache release tarball in the rust-cache action, so a single unsuccessful response no longer fails the job outright.
Why
A job using rust-cache@main failed with curl exit code 22, which curl returns under
--failwhen the server responds with an HTTP status of 400 or above while fetching the sccache binary from GitHub releases. The failing job: https://github.com/stellar/binaries/actions/runs/27119374274/job/80033796245?pr=82. The download was the only network call in the action without any retry handling, so a transient server-side error (rate limiting, 5xx, a momentary CDN hiccup) aborted the whole build. Retrying up to five times with a delay — including on connection-refused and other transient errors — lets these recover automatically, while the existing sha256 checksum verification still guards against accepting a corrupt or partial download.