Skip to content

workflows: retry transient Bazel download failures in setup-bazel - #4291

Merged
rickeylev merged 2 commits into
bazel-contrib:mainfrom
rickeylev:retry_transient_network_downloads
Oct 20, 2026
Merged

rickeylev merged 2 commits into
bazel-contrib:mainfrom
rickeylev:retry_transient_network_downloads

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

bazel-contrib/setup-bazel configures Bazelisk and restores caches,
leaving the Bazel binary download to the first bazel invocation.
Bazelisk retries initial HTTP GET headers, but does not retry
mid-stream io.Copy failures (such as HTTP/2 stream resets from
releases.bazel.build). A failed download also leaves an empty
~/.cache/bazelisk directory that setup-bazel's post step caches.

To prevent transient network flakes, pin Bazelisk to 1.29.0 (for
windows-arm64 support) in the shared setup-bazel composite action,
eagerly run bazel --version with exponential-backoff retries, delete
partial Bazelisk cache directories if all retries fail, and reuse the
shared action in the release artifact build workflow.

`bazel-contrib/setup-bazel` configures Bazelisk and restores caches,
leaving the Bazel binary download to the first `bazel` invocation.
Bazelisk retries initial HTTP GET headers, but does not retry
mid-stream `io.Copy` failures (such as HTTP/2 stream resets from
`releases.bazel.build`). A failed download also leaves an empty
`~/.cache/bazelisk` directory that `setup-bazel`'s post step caches.

To prevent transient network flakes, pin Bazelisk to 1.29.0 (for
`windows-arm64` support) in the shared `setup-bazel` composite action,
eagerly run `bazel --version` with exponential-backoff retries, delete
partial Bazelisk cache directories if all retries fail, and reuse the
shared action in the release artifact build workflow.
@rickeylev
rickeylev requested a review from aignas as a code owner October 20, 2026 04:01
…work_downloads

# Conflicts:
#	.github/workflows/release_build_artifacts.yaml
@rickeylev
rickeylev merged commit d2e6dba into bazel-contrib:main Oct 20, 2026
18 checks passed
@rickeylev
rickeylev deleted the retry_transient_network_downloads branch October 20, 2026 04:31
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.

1 participant