From ce8e611cc1014e1d8e2434f6dc3e26edbcda48ce Mon Sep 17 00:00:00 2001 From: emil User Date: Wed, 12 Aug 2026 21:37:46 +0000 Subject: [PATCH] DEVX-158: fix: increase download retry attempts and backoff for transient GitHub outages --- src/devx/tools/install_tools.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/devx/tools/install_tools.py b/src/devx/tools/install_tools.py index 51aa39c..29e775a 100644 --- a/src/devx/tools/install_tools.py +++ b/src/devx/tools/install_tools.py @@ -50,8 +50,9 @@ logger = logging.getLogger(__name__) # GitHub releases occasionally drops connections ("Remote end closed # connection without response"). Retrying with backoff before falling # through to the next fallback URL makes the build resilient to -# momentary network blips. -MAX_DOWNLOAD_RETRIES = 3 +# momentary network blips. 5 attempts with up to 30s between retries +# handles sustained transient outages (observed in CI image builds). +MAX_DOWNLOAD_RETRIES = 5 ACTIONLINT_VERSION = "1.7.12" @@ -96,7 +97,7 @@ def _download(url: str, dest: Path, *, _sleep=None) -> None: """ retrying = Retrying( 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)), before_sleep=before_sleep_log(logger, logging.WARNING), sleep=_sleep if _sleep is not None else time.sleep,