Skip to content

Make save_large_file robust to transient errors - #351

Open
Sriram-Nambiar wants to merge 2 commits into
openzim:mainfrom
Sriram-Nambiar:issue-348-save-large-file-retries
Open

Sriram-Nambiar wants to merge 2 commits into
openzim:mainfrom
Sriram-Nambiar:issue-348-save-large-file-retries

Conversation

@Sriram-Nambiar

Copy link
Copy Markdown

Replace wget with streaming requests and Range-based resume in save_large_file, fixing #348.

wget treats transient HTTP errors (502/503/504/429) and DNS failures as fatal, and its -t counter is a budget for the entire download rather than consecutive failures without progress.

This matches the solution settled in openzim/zimwright#7:

  • Resumes downloads using HTTP Range requests from the bytes on disk.
  • Only counts attempts that make no progress toward the retry limit.
  • Enforces explicit connect (30s) and read (60s) timeouts to avoid streaming hangs.
  • Retries transient HTTP errors (429, 500, 502, 503, 504) and connection/timeout errors with backoff and jitter.
  • Restarts cleanly from scratch if the server ignores Range (200 OK).

Unit tests added covering all resume, retry, and failure scenarios.

Closes #348.

@Sriram-Nambiar Sriram-Nambiar changed the title Make save_large_file robust to transient errors with progress-based r… Make save_large_file robust to transient errors Oct 15, 2026

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.

save_large_file downloads are not robust to transient HTTP/host errors

1 participant