Merge pull request #64159 from ClickHouse/backport/24.3/64125

Backport #64125 to 24.3: Add retries in `git submodule update`
This commit is contained in:
robot-ch-test-poll2 2024-05-21 03:16:49 +04:00 committed by GitHub
commit 8084310b88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,10 +159,17 @@ function clone_submodules
git submodule sync
git submodule init
# --jobs does not work as fast as real parallel running
printf '%s\0' "${SUBMODULES_TO_UPDATE[@]}" | \
xargs --max-procs=100 --null --no-run-if-empty --max-args=1 \
git submodule update --depth 1 --single-branch
# Network is unreliable
for _ in {1..10}
do
# --jobs does not work as fast as real parallel running
printf '%s\0' "${SUBMODULES_TO_UPDATE[@]}" | \
xargs --max-procs=100 --null --no-run-if-empty --max-args=1 \
git submodule update --depth 1 --single-branch && break
sleep 1
done
git submodule foreach git reset --hard
git submodule foreach git checkout @ -f
git submodule foreach git clean -xfd