Commit a132d5f6 authored by Geoff Brown's avatar Geoff Brown
Browse files

Bug 1756129 - Retry network requests in fetch-chromium.py; r=sparky

Retry network requests to avoid those intermittent failures resulting from temporary network or server outages.

Differential Revision: https://phabricator.services.mozilla.com/D163876
parent 1bb7d07e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ RUN /usr/local/sbin/setup_packages.sh $TASKCLUSTER_ROOT_URL $DOCKER_IMAGE_PACKAG
      bzip2 \
      git \
      openssh-client \
      python3-pip \
      python3-requests \
      python3-zstandard \
      unzip
@@ -31,3 +32,5 @@ ADD topsrcdir/taskcluster/scripts/misc/fetch-content /builds/worker/bin/fetch-co

# %include taskcluster/scripts/misc/fetch-chromium.py
ADD topsrcdir/taskcluster/scripts/misc/fetch-chromium.py /builds/worker/bin/fetch-chromium.py

RUN pip3 install redo==2.0.4
+4 −1
Original line number Diff line number Diff line
@@ -18,9 +18,10 @@ import errno
import os
import shutil
import subprocess
import requests
import tempfile

import requests
from redo import retriable

LAST_CHANGE_URL = (
    # formatted with platform
@@ -67,6 +68,7 @@ def log(msg):
    print("build-chromium: %s" % msg)


@retriable(attempts=5, sleeptime=5, sleepscale=2)
def fetch_file(url, filepath):
    """Download a file from the given url to a given file."""
    size = 4096
@@ -85,6 +87,7 @@ def unzip(zippath, target):
    subprocess.check_call(unzip_command)


@retriable(attempts=5, sleeptime=5, sleepscale=2)
def fetch_chromium_revision(platform):
    """Get the revision of the latest chromium build."""
    chromium_platform = CHROMIUM_INFO[platform]["platform"]