Range resume corrupts files: a 200 response that serves the requested range is treated as a restart
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- python
- 領域
- backend, networking
調査の方向性
_download_with_resume エントリーポイントから開始し、レスポンスのステータスとヘッダーによって書き込みモードと既存のオフセットがどのように決定されるかを調べます。issue に記載された ModelScope のレスポンスを再現し、再開されたダウンロードが切り詰められたりずれたりせず、完了したファイルが SHA-256 チェックに合格することを検証します。
索引モデルが issue の本文から書いたものです。
説明
The ModelScope file endpoint answers a Range request with 200 OK instead of 206 Partial Content, even though it does serve only the requested slice:
curl -sL -o /dev/null -D -
-H 'Range: bytes=1000000000-1000000099'
'https://www.modelscope.cn/api/v1/models/Qwen/Qwen3-VL-8B-Instruct/repo?Revision=master&FilePath=model-00002-of-00004.safetensors'
Returned:
HTTP/1.1 200 OK
Server: nginx/1.24.0
Content-Length: 100
Accept-Ranges: bytes
Content-Range: bytes 1000000000-1000000099/4915962496
100 bytes requested, 100 bytes returned, correct Content-Range — the range is honoured. Only the status code is wrong. Per RFC 9110 §15.3.7 this should be 206.
And it may break the SDK
_download_with_resume decides whether a response is a resume from the status code alone.
is_resumed = resp.status_code == 206
...
mode = "ab" if is_resumed else "wb"
if not is_resumed:
existing_size = 0
So on every resume is_resumed is False, and the .incomplete file is truncated (wb) — but the server is still sending from the requested offset, so mid-file bytes get written at offset 0. The result is a file that is both short and shifted. Nothing notices until the SHA-256 check rejects it, which then deletes the file and restarts from byte 0.
In one run over an unreliable link, /proc//io showed 30.9 GB written for a 17.5 GB model, with 6.1 GB retained.
- 主要言語
- Python
- スター
- 15
- フォーク
- 9
- 平均マージ
- 17時間 7分
- マージ済み PR(30日)
- 8
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelscope/modelscope_hub のほかの issue
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
modelscope/modelscope_hub#58 ·
modelscope/modelscope_hub の issue をすべて見る
似ている issue
-
Workflow.schedule stops when a cron deadline passes before sleep対応中かも @HuaTNA が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
[Bug] HiveDialect shares its colspecs dict with SQLAlchemy's DefaultDialect (python/pyhive)対応中かも @rusackas が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
apache/kyuubi#7786 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
[20.0] hr_work_entry: Duration column of Export Time Entries is truncated to whole hours対応中かも @odooaktiv が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
fix formatting of the sample database page of the docs対応中かも @Aaqibhafeezkhan が今日担当しました。 オープンdocumentation good first issue help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
chaoss/CollectOSS#544 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信