Commit 1607bf45 authored by Matt Kotsenas's avatar Matt Kotsenas Committed by LUCI CQ

Retry CIPD client download on Linux / macOS

Transient network conditions can cause the CIPD client download to fail,
so add a retry to the download.

When using `wget` we additionally retry usually fatal errors like
"connection refused" via `--retry-connrefused`. `curl` also has that
parameter, but it was added more recently in version 7.52.0, which isn't
available on supported platforms like Ubuntu 16.04. Once we raise the
minimum supported version of curl, we should add that parameter as well.

In either case, we retry 3 times and wait 5 seconds between each try,
which matches the retries recently added for Windows.

Bug: 1145741
Change-Id: Ib73bb3413ba4d5251c2b027a87dabd1378ab6c44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2532896Reviewed-by: 's avatarVadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Matthew Kotsenas <mattkot@microsoft.com>
parent c135bfa0
......@@ -155,9 +155,9 @@ function clean_bootstrap() {
mktemp "${MYPATH}/.cipd_client.XXXXXXX")
if hash curl 2> /dev/null ; then
curl "${URL}" -s --show-error -f -A "${USER_AGENT}" -L -o "${CIPD_CLIENT_TMP}"
curl "${URL}" -s --show-error -f --retry 3 --retry-delay 5 -A "${USER_AGENT}" -L -o "${CIPD_CLIENT_TMP}"
elif hash wget 2> /dev/null ; then
wget "${URL}" -q -U "${USER_AGENT}" -O "${CIPD_CLIENT_TMP}"
wget "${URL}" -q -t 3 -w 5 --retry-connrefused -U "${USER_AGENT}" -O "${CIPD_CLIENT_TMP}"
else
>&2 echo -n ""
>&2 echo -n "Your platform is missing a supported fetch command. "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment