Repository navigation
build: retry git clones a few times when they fail - #5488
Merged
Merged
Conversation
I'm pretty fed up with GitHub's reliability. Sometimes a clone just fails, their uptime has been spotty lately. Using our dependency auto-build feature for more packages, more frequently in CI, the opportunities for spurious failures have grown enough that it seems like every CI workflow (with 29 job variants these days) has a good chance of at least one job variant failing. That's a lot of noise in what's supposed to be a reliable signal about whether the PR passes or fails the testsuite on its own merits. So here is me being a little desperte -- I'm adding a CMake function execute_process_with_retry, that we use with the git clones of dependencies (including nanobind and its submodule) and of the test data repos to try up to 5 times before a full failure. After the first failure, it waits 15 seconds. The delay doubles with each failure. If all attempts fail, it's a full job failure. Hopefully, any spurious GitHub clone unavailability that lasts less than a few minutes will just be glossed over and let us complete CI, at the cost of perhaps a minute or two delay, which seems like a small price to pay. Assisted by: Claude Code / claude-opus-5 Signed-off-by: Larry Gritz <lg@larrygritz.com>
lgritz
force-pushed
the
lg-retryclone
branch
from
September 23, 2026 22:37
d00d0dc to
7940f03
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved moderate issues affect failure propagation, cleanup, and retry duration.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Adds configurable exponential retries for Git-based dependency and test-data downloads during CMake configuration.
Changes:
- Introduces a reusable retry helper with cleanup and backoff controls.
- Applies retries to dependencies, submodules, nanobind, and test data.
- Adds retry-related dependency settings.
| File | Reviewed changes and findings |
|---|---|
src/cmake/dependency_utils.cmake |
Adds retry handling. Moderate issues remain: final failures can bypass cleanup, and the default backoff totals 465 seconds. |
src/cmake/testing.cmake |
Adds retries for test-data cloning. The final result is discarded, allowing configuration to continue after failure (moderate). |
src/cmake/build_nanobind.cmake |
Adds retries for nanobind and its submodule. Clone results are discarded, allowing incomplete sources to continue (moderate). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
execute_process_with_retry now removes the CLEANUP dir after every failed attempt, including the last, so a leftover partial clone can't be mistaken for a good checkout on the next configure. nanobind: drop the hand-rolled clone + submodule step and use build_dependency_with_cmake's GIT_SUBMODULES, which checks results and inits submodules after verifying the pinned commit. Assisted-by: Claude Code / claude-opus-5-5 Signed-off-by: Larry Gritz <lg@larrygritz.com>
execute_process_with_retry gains RETRY_COUNT_VARIABLE. New wrapper git_clone_with_retry uses it to log the names of clones that succeeded only after retrying to build/clone-retries.txt; ci-test.bash appends "Recovered from clone failures of: ..." to the step summary when that file is non-empty. Assisted-by: Claude Code / claude-opus-5-5 Signed-off-by: Larry Gritz <lg@larrygritz.com>
Collaborator
Author
|
No objections -> merging I want this in to help reduce the incidence of spurious CI failures when a dependency has an error cloning and needs to retry. |
lgritz
added a commit
to lgritz/OpenImageIO
that referenced
this pull request
Sep 27, 2026
…undation#5488) I'm pretty fed up with GitHub's reliability. Sometimes a clone just fails, their uptime has been spotty lately. Using our dependency auto-build feature for more packages, more frequently in CI, the opportunities for spurious failures have grown enough that it seems like every CI workflow (with 29 job variants these days) has a good chance of at least one job variant failing. That's a lot of noise in what's supposed to be a reliable signal about whether the PR passes or fails the testsuite on its own merits. I'm constantly poking "rerun failed jobs" on people's PRs for no good reason, and having trouble separating which are temporary GitHub failures from which PRs are actually broken. So here is me being a little desperate -- I'm adding a CMake function execute_process_with_retry, that we use with the git clone of dependencies to try up to 5 times before a full failure. After the first failure, it waits 15 seconds. The delay doubles with each failure. If all attempts fail, it's a full job failure. Hopefully, any spurious GitHub clone unavailability that lasts less than a few minutes will just be glossed over and let us complete CI, at the cost of perhaps a minute or two delay, which seems like a small price to pay. Assisted by: Claude Code / claude-opus-5 --------- Signed-off-by: Larry Gritz <lg@larrygritz.com>
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.

I'm pretty fed up with GitHub's reliability. Sometimes a clone just fails, their uptime has been spotty lately. Using our dependency auto-build feature for more packages, more frequently in CI, the opportunities for spurious failures have grown enough that it seems like every CI workflow (with 29 job variants these days) has a good chance of at least one job variant failing. That's a lot of noise in what's supposed to be a reliable signal about whether the PR passes or fails the testsuite on its own merits. I'm constantly poking "rerun failed jobs" on people's PRs for no good reason, and having trouble separating which are temporary GitHub failures from which PRs are actually broken.
So here is me being a little desperate -- I'm adding a CMake function execute_process_with_retry, that we use with the git clone of dependencies to try up to 5 times before a full failure. After the first failure, it waits 15 seconds. The delay doubles with each failure. If all attempts fail, it's a full job failure. Hopefully, any spurious GitHub clone unavailability that lasts less than a few minutes will just be glossed over and let us complete CI, at the cost of perhaps a minute or two delay, which seems like a small price to pay.
Assisted by: Claude Code / claude-opus-5