Commit 51df86ee authored by Julien Cristau's avatar Julien Cristau
Browse files

Bug 1821513 - set a timeout for fetch-content downloads. r=releng-reviewers,gbrown a=release

Setting a timeout on the download means we can retry if the connection
hangs, instead of sitting around idle until the task itself hits its
maxRunTime.

Differential Revision: https://phabricator.services.mozilla.com/D173287
parent 7c877edc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -183,8 +183,8 @@ def stream_download(url, sha256=None, size=None):

    t0 = time.time()
    with urllib.request.urlopen(
        url, cafile=certifi.where()
    ) if certifi else urllib.request.urlopen(url) as fh:
        url, timeout=60, cafile=certifi.where()
    ) if certifi else urllib.request.urlopen(url, timeout=60) as fh:
        if not url.endswith(".gz") and fh.info().get("Content-Encoding") == "gzip":
            fh = gzip.GzipFile(fileobj=fh)