[Bug]: Model download sleeps after its final failed attempt
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
The issue identifies ModelManagement.download_model() in fastembed/common/model_management.py and describes mocked regression cases for one and three attempts, with and without URL fallback. Read the retry and sleep logic, then run the regression cases described in the issue. Done means sleeps occur only between attempts while the attempt count, URL fallback, offline behavior, and final exception remain unchanged.
索引モデルが issue の本文から書いたものです。
説明
What happened?
ModelManagement.download_model() sleeps after the final failed download attempt, even when its retry counter has reached zero.
With the default retries=3, failed downloads sleep for 3, 9 and 27 seconds. Only the first two sleeps precede another attempt; the last 27 seconds delay the final ValueError without retrying anything. With retries=1, a failed attempt still sleeps for three seconds before returning the error.
Minimal reproduction
This reproducer mocks model downloads and sleep, so it needs no model weights or network access:
from unittest.mock import Mock, patch
from fastembed.common.model_description import BaseModelDescription, ModelSource
from fastembed.common.model_management import ModelManagement
model = BaseModelDescription(
model="test/missing-model",
sources=ModelSource(hf="test/missing-model"),
model_file="model.onnx",
description="Test fixture",
license="Apache-2.0",
size_in_GB=0.0,
)
with patch.object(ModelManagement, "download_files_from_huggingface", side_effect=OSError("unavailable")), patch("fastembed.common.model_management.time.sleep") as sleep:
try:
ModelManagement.download_model(model, "/tmp/unused-fastembed-repro", retries=3)
except ValueError:
pass
print(sleep.call_args_list)
Actual: [call(3.0), call(9.0), call(27.0)]
Expected: [call(3.0), call(9.0)]
Run with HF_HUB_OFFLINE unset.
Proposed fix
Sleep only when another attempt remains. Preserve the number of attempts, exponential delays between them, URL fallback, offline behavior and the final exception.
I reproduced this with four regression cases covering one/three attempts, with and without URL fallback. All four fail before the fix because of the extra sleep.
Environment
- FastEmbed 0.9.1 from current main
- Python 3.11.9 on macOS
- Downloads and sleeps mocked; no model downloaded or credentials used
AI assistance: OpenAI Codex. The regression cases were run locally.
- 主要言語
- Python
- スター
- 3.3k
- フォーク
- 289
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 58
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
qdrant/fastembed のほかの issue
-
Weekly tests failed対応中かも @joein が 8 日前に担当しました。 オープン
qdrant/fastembed#843 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: rerank_pairs raises TypeError when pairs are passed as a tuple of pairs対応中かも @michaelkillgta が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
-
[Feature]: Support huggingface-hub 2.0再び着手できるかも @joein が 35 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
qdrant/fastembed#742 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Silent all-NaN embeddings when a model file is incompatible with the runtime (0.8.0 still ships the fp16 jina-de model fixed by #623)対応中かも @Shikhaar が 70 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
qdrant/fastembed#688 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
qdrant/fastembed#679 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
qdrant/fastembed の issue をすべて見る
似ている issue
-
Backend issue lists report in-patch warnings and out-of-patch errors as not publishable対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mozilla/code-review#3794 ·
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Update docs that still describe the security registry as empty対応中かも @github-actions が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
[Bug] adb backup script reports "Done" & exits 0 when the backup fails対応中かも @bhattmanthan が今日担当しました。 オープンrequest-issue-assignment
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
agent-ui bug p2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
correction metadata
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
acl-org/acl-anthology#10768 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信