Skip to content

ci: retry the depot_tools clones and the angle fetch on transient network errors - #53470

Merged
MarshallOfSound merged 1 commit into
mainfrom
sam/ci-retry-network-fetches
Sep 3, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
sam/ci-retry-network-fetches

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Description of Change

Three CI steps fetch over the network with no retry, and each has failed builds on main with errors that pass on a re-run:

This adds script/actions/retry.sh, which reruns a command with exponential backoff (4 attempts, waiting 1s, 4s and 16s; tunable through RETRY_ATTEMPTS, RETRY_DELAY and RETRY_FACTOR), and prefixes those commands with it. It's a script rather than a composite action so each step stays a plain run: and no command has to pass through an action input. Each wrapped command is safe to repeat: a failed git clone removes its partial directory, and a failed git fetch leaves the repository as it was. A retry shows up as a warning annotation; after the last attempt the step fails with the command's own exit code, as it does today.

The depot_tools clone inside build-tools itself gets the same treatment in electron/build-tools#895, which CI picks up on its next release because this action installs the latest build-tools.

Checklist

Release Notes

Notes: none

…work errors

Three CI steps fetch over the network with no retry, and each has failed
builds on main with errors that pass on a re-run:

- the test job's "Get Depot Tools" clone from googlesource.com
- "Install Build Tools" (npm install, then the depot_tools clone that the
  first `e` command does): "fetch-pack: invalid index-pack output"
- "Fixup angle git" in fix-sync, a large `git fetch` from github.com:
  "RPC failed; curl 56 Recv failure: Operation timed out"

Add script/actions/retry.sh, which reruns a command with exponential backoff
(4 attempts, waiting 1s, 4s and 16s), and use it for those commands. Each
one is safe to repeat: a failed clone removes its partial directory, and a
failed fetch leaves the repository unchanged.
@MarshallOfSound MarshallOfSound added target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 3, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 3, 2026 20:08
@MarshallOfSound
MarshallOfSound merged commit 3f9ded2 into main Sep 3, 2026
112 checks passed
@MarshallOfSound
MarshallOfSound deleted the sam/ci-retry-network-fetches branch September 3, 2026 20:26
@release-clerk

release-clerk Bot commented Sep 3, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #53472

@trop trop Bot added the in-flight/45-x-y label Sep 3, 2026
@trop

trop Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #53473

@trop

trop Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #53474

@trop trop Bot added in-flight/44-x-y and removed target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 3, 2026
@trop

trop Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #53475

@trop trop Bot added in-flight/43-x-y in-flight/42-x-y and removed target/44-x-y PR should also be added to the "44-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. labels Sep 3, 2026
claude Bot pushed a commit that referenced this pull request Sep 3, 2026
…atches-merge-driver

Resolve the adjacent-line conflict in .github/actions/install-build-tools/action.yml:
keep BUILD_TOOLS_SHA=6bd58bb51aedf9029ed495e79b32dcbf63c181da from this branch and
take the retry.sh wrapping from main (#53470).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FjcRsjpBz7eMoAAxSxtBrU
@trop trop Bot removed the in-flight/42-x-y label Sep 3, 2026
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. and removed in-flight/44-x-y in-flight/45-x-y in-flight/43-x-y labels Sep 3, 2026
MarshallOfSound pushed a commit that referenced this pull request Sep 3, 2026
script/actions/retry.sh (#53470, backported in #53473) assumed that a
failed `git clone` removes its directory, so it rerun the command as is.
That is only true while git is still fetching the pack: once the
repository has been written, a failure in the checkout stage keeps the
directory, and with --filter=tree:0 the checkout still fetches trees over
the network. In the 44-x-y run for #53479, the "Get Depot Tools" step lost
DNS mid-clone ("fatal: could not fetch ... from promisor remote"), left
./depot_tools behind, and every retry then failed with "fatal: destination
path 'depot_tools' already exists and is not an empty directory", so the
wrapper turned one transient error into a guaranteed failure.

Add an opt-in RETRY_CLEAN_PATH to retry.sh: when set, the path is removed
before each retry, never before the first attempt, and set it to
depot_tools at the clone call site. The other callers (npm install, `e d
update_depot_tools`, `git fetch`) are unchanged.


Claude-Session: https://claude.ai/code/session_01Pgo4hKUF1UNQCWyBFwRdjg

Co-authored-by: Claude <[email protected]>
MarshallOfSound pushed a commit that referenced this pull request Sep 4, 2026
script/actions/retry.sh (#53470, backported in #53473) assumed that a
failed `git clone` removes its directory, so it rerun the command as is.
That is only true while git is still fetching the pack: once the
repository has been written, a failure in the checkout stage keeps the
directory, and with --filter=tree:0 the checkout still fetches trees over
the network. In the 44-x-y run for #53479, the "Get Depot Tools" step lost
DNS mid-clone ("fatal: could not fetch ... from promisor remote"), left
./depot_tools behind, and every retry then failed with "fatal: destination
path 'depot_tools' already exists and is not an empty directory", so the
wrapper turned one transient error into a guaranteed failure.

Add an opt-in RETRY_CLEAN_PATH to retry.sh: when set, the path is removed
before each retry, never before the first attempt, and set it to
depot_tools at the clone call site. The other callers (npm install, `e d
update_depot_tools`, `git fetch`) are unchanged.


Claude-Session: https://claude.ai/code/session_01Pgo4hKUF1UNQCWyBFwRdjg

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Claude <[email protected]>
MarshallOfSound pushed a commit that referenced this pull request Sep 4, 2026
script/actions/retry.sh (#53470, backported in #53473) assumed that a
failed `git clone` removes its directory, so it rerun the command as is.
That is only true while git is still fetching the pack: once the
repository has been written, a failure in the checkout stage keeps the
directory, and with --filter=tree:0 the checkout still fetches trees over
the network. In the 44-x-y run for #53479, the "Get Depot Tools" step lost
DNS mid-clone ("fatal: could not fetch ... from promisor remote"), left
./depot_tools behind, and every retry then failed with "fatal: destination
path 'depot_tools' already exists and is not an empty directory", so the
wrapper turned one transient error into a guaranteed failure.

Add an opt-in RETRY_CLEAN_PATH to retry.sh: when set, the path is removed
before each retry, never before the first attempt, and set it to
depot_tools at the clone call site. The other callers (npm install, `e d
update_depot_tools`, `git fetch`) are unchanged.


Claude-Session: https://claude.ai/code/session_01Pgo4hKUF1UNQCWyBFwRdjg

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Claude <[email protected]>
MarshallOfSound pushed a commit that referenced this pull request Sep 4, 2026
script/actions/retry.sh (#53470, backported in #53473) assumed that a
failed `git clone` removes its directory, so it rerun the command as is.
That is only true while git is still fetching the pack: once the
repository has been written, a failure in the checkout stage keeps the
directory, and with --filter=tree:0 the checkout still fetches trees over
the network. In the 44-x-y run for #53479, the "Get Depot Tools" step lost
DNS mid-clone ("fatal: could not fetch ... from promisor remote"), left
./depot_tools behind, and every retry then failed with "fatal: destination
path 'depot_tools' already exists and is not an empty directory", so the
wrapper turned one transient error into a guaranteed failure.

Add an opt-in RETRY_CLEAN_PATH to retry.sh: when set, the path is removed
before each retry, never before the first attempt, and set it to
depot_tools at the clone call site. The other callers (npm install, `e d
update_depot_tools`, `git fetch`) are unchanged.


Claude-Session: https://claude.ai/code/session_01Pgo4hKUF1UNQCWyBFwRdjg

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Claude <[email protected]>
MarshallOfSound pushed a commit that referenced this pull request Sep 4, 2026
script/actions/retry.sh (#53470, backported in #53473) assumed that a
failed `git clone` removes its directory, so it rerun the command as is.
That is only true while git is still fetching the pack: once the
repository has been written, a failure in the checkout stage keeps the
directory, and with --filter=tree:0 the checkout still fetches trees over
the network. In the 44-x-y run for #53479, the "Get Depot Tools" step lost
DNS mid-clone ("fatal: could not fetch ... from promisor remote"), left
./depot_tools behind, and every retry then failed with "fatal: destination
path 'depot_tools' already exists and is not an empty directory", so the
wrapper turned one transient error into a guaranteed failure.

Add an opt-in RETRY_CLEAN_PATH to retry.sh: when set, the path is removed
before each retry, never before the first attempt, and set it to
depot_tools at the clone call site. The other callers (npm install, `e d
update_depot_tools`, `git fetch`) are unchanged.


Claude-Session: https://claude.ai/code/session_01Pgo4hKUF1UNQCWyBFwRdjg

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/none

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants