Skip to content

ci: retry transient remote-endpoint failures in the Bazel Native lanes - #2897

Open
b7r6 wants to merge 1 commit into
TraceMachina:mainfrom
b7r6:ci/bazel-retry-remote-grpc
Open

b7r6 wants to merge 1 commit into
TraceMachina:mainfrom
b7r6:ci/bazel-retry-remote-grpc

Conversation

@b7r6

@b7r6 b7r6 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

What and why

A transient Connection refused from the staging CAS endpoint during Bazel's remote-capabilities query fails a lane outright. Concretely: on the #2826 merge push (run 36815211094, job Redis store tester), the build died with Failed to query remote execution capabilities: ... Connection refused: cas-*:443 (exit 34) before any test ran — and the same lane passed on the next 14 main runs. A pure endpoint blip put a red X on an unrelated scheduler PR.

Two gaps closed:

  1. tools/bazel-retry.sh existed for exactly this class but its transient pattern only covered HTTP fetch failures (403/429/5xx, Connection reset/timed out); it would not have matched this gRPC failure. The pattern now also matches Connection refused, Failed to query remote execution capabilities, and gRPC UNAVAILABLE: — still gated on ^ERROR: lines, still max 3 attempts with backoff, so a real test failure does not retry.
  2. The Bazel Native workflow called raw bazel (only the Nix and LRE workflows used the wrapper). The Linux/macOS test arms and the three Redis store tester invocations now go through ./tools/bazel-retry.sh. The Windows arm is left raw in this pass — it passes a startup option (--output_user_root) ahead of the subcommand and deserves its own verification.

How was this verified?

The new pattern was checked against the actual failing log of run 36815211094: its ERROR: lines match Connection refused/Failed to query remote execution capabilities, so the wrapper would have retried instead of failing the job. Shellcheck/shfmt and YAML validation pass via the repo pre-commit hooks. tools/bazel-retry.sh is committed with the executable bit (100755), so the ./tools/... invocation works on the runner. Not yet observed over a live endpoint blip — by nature that needs the next one to occur.

Risk

Low. Retry only triggers when an ^ERROR: line matches the transient pattern; deterministic build/test failures still fail on the first attempt. Worst case is up to two extra attempts (≈15 s backoff plus rebuild time) during a genuine prolonged outage before the lane fails anyway. The Windows arm's behavior is unchanged.

AI assistance

An agent (Claude Code) performed the failure triage and drafted this change and description; I reviewed every line and the gating pattern against the original failure log.

A transient connection-refused from the staging CAS during Bazel's
remote-capabilities query fails the build outright (2026-10-01, run
36815211094: the Redis store tester went red on the TraceMachina#2826 merge push and
green on the next 14 main runs — pure endpoint blip, unrelated change
blamed). Two gaps closed:

- tools/bazel-retry.sh: the transient pattern now also matches
  'Connection refused', 'Failed to query remote execution capabilities',
  and gRPC 'UNAVAILABLE:' (still gated on ^ERROR: lines, max 3 attempts).
- native-bazel.yaml: the Linux/macOS test arms and the three Redis store
  tester invocations go through bazel-retry instead of raw bazel. The
  Windows arm is left raw for now (different startup-flag shape).
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nativelink Ready Ready Preview Oct 5, 2026 4:49pm UTC
nativelink-aidm Ready Ready Preview Oct 5, 2026 4:49pm UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – nativelink — df5e8f32 Deployed Oct 5, 2026 by vercel[bot]
Preview – nativelink-aidm — df5e8f32 Deployed Oct 5, 2026 by vercel[bot]
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