Batch: re-added rate-limited objects stay in results.objs.all_responses as errors
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
weaviate/collections/batch/base.py の _BatchBase.__send_batch から始め、mock gRPC fixture を使って mock_tests/test_probe_readd_dep020.py で再現します。retry によって古い ErrorObject が削除され、Dep020 警告が出力されず、非推奨の all_responses を読み取ることなく 4 つの結果エントリが残ることを確認します。
索引モデルが issue の本文から書いたものです。
説明
A rate-limited batch emits Dep020 in code that never reads all_responses, because the re-add in _BatchBase.__send_batch reads the deprecated property (weaviate/collections/batch/base.py:720). That line also filters by list position, while errors and uuids filter by the batch-wide index of the object. From the second chunk on the two differ, and the ErrorObject of the re-added object stays in _all_responses after its retry succeeds.
Mock gRPC server at 38f30c1 with the mock_tests/conftest.py fixtures, 4 objects through fixed_size(batch_size=2, concurrent_requests=1), the first object of the second chunk rate-limited once. The test never reads all_responses:
$ pytest mock_tests/test_probe_readd_dep020.py -q -s
Dep020 during batch=1 errors=0 len(_all_responses)=5 stale=1
mock_tests/test_probe_readd_dep020.py
import warnings
import weaviate
from weaviate.collections.classes.batch import ErrorObject
from weaviate.proto.v1 import batch_pb2, weaviate_pb2_grpc
from .conftest import MOCK_IP, MOCK_PORT, MOCK_PORT_GRPC, mock_class
class Svc(weaviate_pb2_grpc.WeaviateServicer):
calls = 0
def BatchObjects(self, request, context):
self.calls += 1
if self.calls == 2: # second chunk, once: rate-limit its first object
return batch_pb2.BatchObjectsReply(errors=[{"index": 0, "error": "failed with status: 503 error"}])
return batch_pb2.BatchObjectsReply()
def test_readd(weaviate_mock, start_grpc_server):
weaviate_mock.expect_request(f"/v1/schema/{mock_class['class']}").respond_with_json(mock_class)
weaviate_pb2_grpc.add_WeaviateServicer_to_server(Svc(), start_grpc_server)
client = weaviate.connect_to_local(port=MOCK_PORT, host=MOCK_IP, grpc_port=MOCK_PORT_GRPC)
try:
col = client.collections.use(mock_class["class"])
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
with col.batch.fixed_size(batch_size=2, concurrent_requests=1) as b:
for i in range(4):
b.add_object({"name": f"o{i}"})
r = col.batch.results.objs
dep = [x for x in w if "all_responses" in str(x.message)]
stale = [x for x in r._all_responses if isinstance(x, ErrorObject)]
print(f"\nDep020 during batch={len(dep)} errors={len(r.errors)} "
f"len(_all_responses)={len(r._all_responses)} stale={len(stale)}")
finally:
client.close()
Expected: no warning and 4 entries. Reading _all_responses and filtering on err.object_.index fixes both. #2166 already edits this function.
@tsmith023, you added Dep020. Would you rather take that one-line fix, or remove all_responses now that its Q4 2024 date has passed?
- 主要言語
- Python
- スター
- 228
- フォーク
- 161
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
weaviate/weaviate-python-client のほかの issue
-
insert_many silently discards vectors if they're NumPy arrays対応中かも @tibor-reiss が 824 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
weaviate/weaviate-python-client#1002 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
Client-side batching: wholesale chunk failures are reported under chunk-local indices, so errors collide and describe the wrong objects対応中かも @feiiiiii5 が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 15/100
weaviate/weaviate-python-client#2165 ·
メンテナーはふだん 1 日以内に返信
-
[HTTPXodus] Consider migrating from httpx to httpx2 (the actively maintained fork)対応中かも @SiAgentBuild が 46 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
weaviate/weaviate-python-client#2154 ·
メンテナーはふだん 1 日以内に返信
-
fetch_objects(limit=0) returns a default page of objects instead of none対応中かも @databyjp が 5 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
weaviate/weaviate-python-client#2150 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Batch stream recovery closes the shared connection and can leave the client permanently closed対応中かも @g-despot が 59 日前に担当しました。 オープンbug
weaviate/weaviate-python-client#2139 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
weaviate/weaviate-python-client の issue をすべて見る
似ている issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
good first issue module-baseline needs triage ux
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
darnitdevorg/darnit#650 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nyjc-computing/campus#938 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nf-osi/nf-metadata-dictionary#1027 ·
メンテナーはふだん 1 日以内に返信
-
bug documentation
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
qatrackplus/qatrackplus#913 ·
メンテナーはふだん 3 日以内に返信