fix: increase download retry attempts and backoff for transient GitHub outages
The CI image build (run 3597) failed because install_tools._download exhausted its 3 retry attempts on RemoteDisconnected errors from GitHub releases. The max backoff of 10s was too short for sustained transient outages. - Increase MAX_DOWNLOAD_RETRIES from 3 to 5 - Increase max backoff from 10s to 30s DEVX-158 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
544de0bf27
commit
0b47975955
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user