Bug 1481178: Retry downloading `chainOfTrust.json.asc` in `mach artifact toolchain`; r=gps a=tomprince
authorTom Prince <mozilla@hocat.ca>
Fri, 17 Aug 2018 15:20:37 -0600
changeset 487283 3ef1c0555a29
parent 487282 a75079e6f234
child 487293 1c0e36dd2c45
child 487318 d41406e52ae3
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps, tomprince
bugs1481178
milestone63.0a1
first release with
nightly linux32
3ef1c0555a29 / 63.0a1 / 20180817220110 / files
nightly linux64
3ef1c0555a29 / 63.0a1 / 20180817220110 / files
nightly mac
3ef1c0555a29 / 63.0a1 / 20180817220110 / files
nightly win32
3ef1c0555a29 / 63.0a1 / 20180817220110 / files
nightly win64
3ef1c0555a29 / 63.0a1 / 20180817220110 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1481178: Retry downloading `chainOfTrust.json.asc` in `mach artifact toolchain`; r=gps a=tomprince Differential Revision: https://phabricator.services.mozilla.com/D3661
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1339,19 +1339,26 @@ class PackageFrontend(MachCommandBase):
 
             def validate(self):
                 if self.size is None and self.digest is None:
                     return True
                 return super(DownloadRecord, self).validate()
 
         class ArtifactRecord(DownloadRecord):
             def __init__(self, task_id, artifact_name):
-                cot = cache._download_manager.session.get(
-                    get_artifact_url(task_id, 'public/chainOfTrust.json.asc'))
-                cot.raise_for_status()
+                for _ in redo.retrier(attempts=retry+1, sleeptime=60):
+                    cot = cache._download_manager.session.get(
+                        get_artifact_url(task_id, 'public/chainOfTrust.json.asc'))
+                    if cot.status_code >= 500:
+                        continue
+                    cot.raise_for_status()
+                    break
+                else:
+                    cot.raise_for_status()
+
                 digest = algorithm = None
                 data = {}
                 # The file is GPG-signed, but we don't care about validating
                 # that. Instead of parsing the PGP signature, we just take
                 # the one line we're interested in, which starts with a `{`.
                 for l in cot.content.splitlines():
                     if l.startswith('{'):
                         try: