Skip to content

fix: survive short network outages when downloading - #2953

Open
henryiii wants to merge 3 commits into
pypa:mainfrom
henryiii:fix/network-retry-backoff
Open

fix: survive short network outages when downloading#2953
henryiii wants to merge 3 commits into
pypa:mainfrom
henryiii:fix/network-retry-backoff

Conversation

@henryiii

@henryiii henryiii commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

A CI runner lost DNS for approximately a minute during a test run, which failed two macOS Intel jobs. Neither layer of retry was long enough to survive it.

  • download() waited a flat 3 seconds over 3 attempts, so it covered only about 6 seconds of downtime. It now waits 3, 6, 12, 24, then 48 seconds over 6 attempts. This helps users on unreliable networks, not only CI. The PyPy download was the one that failed.
  • A 4xx response now fails immediately, because a bad URL will not fix itself. Without this, the longer backoff would delay the report by about 93 seconds. A 5xx response is still retried.
  • uv stops after 3 retries. UV_HTTP_RETRIES is now set to 6 for the test workflow.

henryiii added 3 commits July 27, 2026 12:01
The retry used a flat 3 second wait over 3 attempts, which covers only
about 6 seconds of downtime. A CI runner lost DNS for approximately a
minute and the PyPy download failed. Wait 3, 6, 12, 24, then 48 seconds
over 6 attempts.

Assisted-by: ClaudeCode:claude-opus-5
uv stops after 3 retries, which was too few when a runner lost DNS for
approximately a minute during a test run.

Assisted-by: ClaudeCode:claude-opus-5
A bad URL will not fix itself, and the longer backoff made the wait
before the report about 93 seconds. Report 4xx responses at once, and
keep retrying 5xx.

Assisted-by: ClaudeCode:claude-opus-5
@henryiii
henryiii force-pushed the fix/network-retry-backoff branch from 57a7c5e to e3a465a Compare July 27, 2026 16:18
@henryiii henryiii changed the title fix: survive short network outages when downloading tests: survive short network outages when downloading Jul 27, 2026
@henryiii henryiii changed the title tests: survive short network outages when downloading fix: survive short network outages when downloading Jul 27, 2026

@agriyakhetarpal agriyakhetarpal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope that these issues don't persist on the runners' side, but having our own exponential backoff makes sense to me, especially since it makes our and our users' lives easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants