DEVX-158: fix: increase download retry attempts and backoff for transient GitHub outages

This commit is contained in:
emil User
2026-08-12 21:37:46 +00:00
parent 544de0bf27
commit ce8e611cc1
+4 -3
View File
@@ -50,8 +50,9 @@ logger = logging.getLogger(__name__)
# GitHub releases occasionally drops connections ("Remote end closed # GitHub releases occasionally drops connections ("Remote end closed
# connection without response"). Retrying with backoff before falling # connection without response"). Retrying with backoff before falling
# through to the next fallback URL makes the build resilient to # through to the next fallback URL makes the build resilient to
# momentary network blips. # momentary network blips. 5 attempts with up to 30s between retries
MAX_DOWNLOAD_RETRIES = 3 # handles sustained transient outages (observed in CI image builds).
MAX_DOWNLOAD_RETRIES = 5
ACTIONLINT_VERSION = "1.7.12" ACTIONLINT_VERSION = "1.7.12"
@@ -96,7 +97,7 @@ def _download(url: str, dest: Path, *, _sleep=None) -> None:
""" """
retrying = Retrying( retrying = Retrying(
stop=stop_after_attempt(MAX_DOWNLOAD_RETRIES), stop=stop_after_attempt(MAX_DOWNLOAD_RETRIES),
wait=wait_exponential(multiplier=2, min=2, max=10), wait=wait_exponential(multiplier=2, min=2, max=30),
retry=retry_if_exception_type((urllib.error.URLError, OSError, ConnectionError)), retry=retry_if_exception_type((urllib.error.URLError, OSError, ConnectionError)),
before_sleep=before_sleep_log(logger, logging.WARNING), before_sleep=before_sleep_log(logger, logging.WARNING),
sleep=_sleep if _sleep is not None else time.sleep, sleep=_sleep if _sleep is not None else time.sleep,