Skip to content

Make rust-cache sccache download network-resilient - #104

Merged
leighmcculloch merged 3 commits into
mainfrom
rust-cache-resilient-sccache-download
Jun 8, 2026
Merged

Make rust-cache sccache download network-resilient#104
leighmcculloch merged 3 commits into
mainfrom
rust-cache-resilient-sccache-download

Conversation

@leighmcculloch

@leighmcculloch leighmcculloch commented Jun 8, 2026

Copy link
Copy Markdown
Member

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 --fail when 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.

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
Copilot AI review requested due to automatic review settings June 8, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 curl retry options (--retry, --retry-delay, --retry-connrefused, --retry-all-errors) for the sccache download.
  • Add a curl connection 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.

Comment thread rust-cache/action.yml
@leighmcculloch
leighmcculloch requested review from fnando and mootz12 June 8, 2026 13:19
@leighmcculloch
leighmcculloch enabled auto-merge (squash) June 8, 2026 15:34
@leighmcculloch
leighmcculloch merged commit 5374796 into main Jun 8, 2026
8 checks passed
@leighmcculloch
leighmcculloch deleted the rust-cache-resilient-sccache-download branch June 8, 2026 15:35
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.
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.

3 participants