Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retry logic on git submodule loads #111

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

ptgott
Copy link
Contributor

@ptgott ptgott commented Jan 16, 2025

Sometimes a transient network error prevents git submodule loads from succeeding while building the docs site. Edit the update_submodules.sh script to add rudimentary retry logic. If git submodule update fails, retry the command for up to five attempts, with the time between retries increasing by five seconds each time.

This change introduces this approach because it is not possible to configure HTTP request retries in the git config, nor is there a curl environment variable we can set to enable retries in git's https:// transport.

Sometimes a transient network error prevents git submodule loads from
succeeding while building the docs site. Edit the `update_submodules.sh`
script to add rudimentary retry logic. If `git submodule update` fails,
retry the command for up to five attempts, with the time between retries
increasing by five seconds each time.

This change introduces this approach because it is not possible to
configure HTTP request retries in the git config, nor is there a curl
environment variable we can set to enable retries in git's `https://`
transport.
@ptgott ptgott requested a review from taraspos January 16, 2025 20:53
Copy link

github-actions bot commented Jan 16, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
paul.gottschling/2025-01-16-retries c5ece6b 5 ✅SUCCEED paul-gottschling-2025-01-16-retries 2025-01-17 16:51:54

@ptgott ptgott requested a review from taraspos January 17, 2025 16:40
@taraspos taraspos merged commit 3ee5151 into main Jan 17, 2025
4 checks passed
@taraspos taraspos deleted the paul.gottschling/2025-01-16-retries branch January 17, 2025 17:31
@taraspos
Copy link
Contributor

2025-01-20T11:26:30.974Z [INFO]: $ scripts/update_submodules.sh
2025-01-20T11:28:08.736Z [INFO]: Submodule path 'content/15.x': checked out '07e5f9660de3df92641902398ed1170a960af0ff'
2025-01-20T11:29:38.833Z [INFO]: Submodule path 'content/16.x': checked out '2d9209393cd16c62f74395bec6ac8f110869c818'
2025-01-20T11:31:25.360Z [INFO]: Submodule path 'content/17.x': checked out 'c691d37359d393c100309581bdc04399d9ad6b52'
2025-01-20T11:32:16.493Z [WARNING]: error: RPC failed; curl 92 HTTP/2 stream 13 was not closed cleanly: CANCEL (err 8)
error: 7193 bytes of body are still expected
2025-01-20T11:32:16.516Z [WARNING]: fetch-pack: unexpected disconnect while reading sideband packet
2025-01-20T11:32:16.533Z [WARNING]: fatal: early EOF
2025-01-20T11:32:16.542Z [WARNING]: fatal: fetch-pack: invalid index-pack output
2025-01-20T11:32:16.545Z [WARNING]: fatal: Unable to fetch in submodule path 'content/18.x'
2025-01-20T11:32:16.546Z [INFO]: Failed to load submodules. Trying again in 5s.
2025-01-20T11:34:01.474Z [INFO]: Submodule path 'content/18.x': checked out 'd7f4b86973e8a43baf25f5ef5ea09e0a7e92f470'

Retry logic works as expected.

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.

2 participants