Skip to content

snapshotter: Retry short downloads and time out reads - #394

Merged
martinpitt merged 1 commit into
amutable:mainfrom
daandemeyer:snapshotter-retries
Nov 10, 2026
Merged

martinpitt merged 1 commit into
amutable:mainfrom
daandemeyer:snapshotter-retries

Conversation

@daandemeyer

Copy link
Copy Markdown
Member

download() opens a URL without a timeout, so a server that stops sending blocks a refresh forever. A
server that closes the connection early also goes unnoticed when no size was stated, and a chunked
transfer that ends early raises IncompleteRead, which with_retries() doesn't retry. Let's time out each
read after a minute and turn both kinds of early end into a ConnectionError, which with_retries() retries.

download() opens a URL without a timeout, so a server that stops sending
blocks a refresh forever. A server that closes the connection early also
goes unnoticed when no size was stated: http.client returns the short body
without an error, and a chunked transfer that ends early raises
IncompleteRead, which with_retries() doesn't retry. Let's time out each read
after a minute and turn both kinds of early end into a ConnectionError, which
with_retries() retries.

Signed-off-by: Daan De Meyer <daan@amutable.com>

@martinpitt martinpitt 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.

cheers!

@martinpitt

Copy link
Copy Markdown
Member

this flake repeats, but it's obviously unrelated to this PR. I'll have a look at it separately.

@martinpitt
martinpitt merged commit 50e4415 into amutable:main Nov 10, 2026
9 of 11 checks passed
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