Skip to content

Retry artifact downloads that slow to a trickle - #2584

Open
electrum wants to merge 1 commit into
actions:mainfrom
electrum:user/electrum/artifact-download-throughput-watchdog
Open

electrum wants to merge 1 commit into
actions:mainfrom
electrum:user/electrum/artifact-download-throughput-watchdog

Conversation

@electrum

@electrum electrum commented Nov 22, 2026 •

Copy link
Copy Markdown

Artifact downloads only give up on a connection when no data arrives for 30 seconds. A connection that keeps trickling data never hits that limit, so the download continues at whatever rate it gets and the existing retries are never used.

For example, a 1.98 GB artifact took 83 minutes to download (about 400 KB/s on average) in a single attempt with no retries. The same artifact normally downloads in 16 to 156 seconds.

With this change, once a download attempt has been running for 30 seconds, it is checked every second, and it is aborted and retried on a new connection if less than 1 MiB/s arrived on average over the trailing 30 seconds. A brief dip in an otherwise healthy download does not trigger it. Periods where the download is slow because writing to disk can't keep up are not counted, since a new connection would not help. A download like the one above, averaging well below 1 MiB/s for over an hour, must have at least one 30 second stretch below 1 MiB/s, so its first attempt would be aborted and retried instead of running to completion.

The last of the 5 attempts runs without this check, so a connection that stays below 1 MiB/s on every attempt still completes, after up to four aborted attempts of about 35 seconds each.

Related:

@electrum
electrum requested a review from a team as a code owner November 22, 2026 02:54
Copilot AI balanced review requested due to automatic review settings November 22, 2026 02:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@electrum
electrum force-pushed the user/electrum/artifact-download-throughput-watchdog branch from 6f42378 to 56246f0 Compare November 22, 2026 04:16
Artifact downloads only gave up on a connection when no data arrived
for 30 seconds, so a connection that kept trickling data could take
over an hour to finish without ever being retried. A download attempt
is now aborted and retried on a new connection when less than 1 MiB/s
arrived over the last 30 seconds. The last attempt runs without this
check, so a connection that is slow on every attempt still completes.
@electrum
electrum force-pushed the user/electrum/artifact-download-throughput-watchdog branch from 56246f0 to 4ae93e0 Compare November 22, 2026 04:40

This branch has not been deployed

No deployments
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