Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

save_large_file downloads are not robust to transient HTTP/host errors

クローズ 初心者向け
#348 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Sriram-Nambiar がすでに取り組んでいます。

2026年10月15日 から。

  • #349 @pawank925 による — マージ済み
  • #351 @Sriram-Nambiar による — マージされずにクローズ

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
tooling

調査の方向性

wget コマンドは zimscraperlib/download.py の save_large_file() で組み立てられています。まずそこから始めて、既存の --retry-connrefused フラグを確認してください。修正では、HTTP エラー(502/503/504/429)およびホスト名解決の失敗に対する wget のリトライオプションを追加し、その後コマンド文字列を確認します。コマンドがこれらの一時的なエラーを再試行し、ダウンロードの途中で 503 を返すローカルサーバーに対して変更が確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

save_large_file() (in zimscraperlib/download.py) shells out to wget with:

wget -t {retries} --retry-connrefused --random-wait --progress=dot:giga -O {fpath} -c {url}

In production (see openzim/zimwright#3), a download failed twice in a row, and it looked like wget wasn't retrying interrupted downloads at all, despite -t {retries} being set.

By default, wget only retries on a specific set of transient errors. Per its manual:

The default is to retry 20 times, with the exception of fatal errors like "connection refused" or "not found" (404), which are not retried.

This command only overrides that for connection-refused (--retry-connrefused). It does not cover:

  • Non-2xx HTTP responses such as 502/503/504/429 — a transient error from a flaky server/CDN/proxy mid-download — which wget treats as fatal and aborts on, with zero retries.
  • Host/DNS resolution errors ("Temporary failure in name resolution"), also fatal by default.

Since large file downloads can run for a long time, a brief upstream hiccup returning one of these responses is enough to abort the whole download, with no retry attempted at all — this matches what was observed in the zimwright recipe run.

主要言語
Python
スター
31
フォーク
32
平均マージ
3日 10時間
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openzim/python-scraperlib のほかの issue

openzim/python-scraperlib の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。