mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
project: ignore more curl failure modes
Current clone bundle fetches from Google storage results HTTP/404 and curl exiting 56. This is basically WAI, so stop emitting verbose error output whenever that happens. Also add a few more curl exit statuses based on chromite history, and document them. Change-Id: I3109f8a8a19109ba9bbd62780b40bbcd4fce9b76 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/432197 Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
9bf8236c24
commit
0444ddf78e
17
project.py
17
project.py
@ -2806,6 +2806,8 @@ class Project:
|
|||||||
def _FetchBundle(self, srcUrl, tmpPath, dstPath, quiet, verbose):
|
def _FetchBundle(self, srcUrl, tmpPath, dstPath, quiet, verbose):
|
||||||
platform_utils.remove(dstPath, missing_ok=True)
|
platform_utils.remove(dstPath, missing_ok=True)
|
||||||
|
|
||||||
|
# We do not use curl's --retry option since it generally doesn't
|
||||||
|
# actually retry anything; code 18 for example, it will not retry on.
|
||||||
cmd = ["curl", "--fail", "--output", tmpPath, "--netrc", "--location"]
|
cmd = ["curl", "--fail", "--output", tmpPath, "--netrc", "--location"]
|
||||||
if quiet:
|
if quiet:
|
||||||
cmd += ["--silent", "--show-error"]
|
cmd += ["--silent", "--show-error"]
|
||||||
@ -2842,11 +2844,18 @@ class Project:
|
|||||||
(output, _) = proc.communicate()
|
(output, _) = proc.communicate()
|
||||||
curlret = proc.returncode
|
curlret = proc.returncode
|
||||||
|
|
||||||
if curlret == 22:
|
if curlret in (22, 35, 56, 92):
|
||||||
|
# We use --fail so curl exits with unique status.
|
||||||
# From curl man page:
|
# From curl man page:
|
||||||
# 22: HTTP page not retrieved. The requested url was not found
|
# 22: HTTP page not retrieved. The requested url was not found
|
||||||
# or returned another error with the HTTP error code being 400
|
# or returned another error with the HTTP error code being
|
||||||
# or above. This return code only appears if -f, --fail is used.
|
# 400 or above.
|
||||||
|
# 35: SSL connect error. The SSL handshaking failed. This can
|
||||||
|
# be thrown by Google storage sometimes.
|
||||||
|
# 56: Failure in receiving network data. This shows up with
|
||||||
|
# HTTP/404 on Google storage.
|
||||||
|
# 92: Stream error in HTTP/2 framing layer. Basically the same
|
||||||
|
# as 22 -- Google storage sometimes throws 500's.
|
||||||
if verbose:
|
if verbose:
|
||||||
print(
|
print(
|
||||||
"%s: Unable to retrieve clone.bundle; ignoring."
|
"%s: Unable to retrieve clone.bundle; ignoring."
|
||||||
|
Loading…
Reference in New Issue
Block a user