Batch: re-added rate-limited objects stay in results.objs.all_responses as errors
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
Hướng nghiên cứu
Bắt đầu trong weaviate/collections/batch/base.py tại _BatchBase.__send_batch và tái hiện bằng mock_tests/test_probe_readd_dep020.py với các fixture gRPC mock. Xác minh rằng retry loại bỏ ErrorObject cũ, không phát ra cảnh báo Dep020 và để lại bốn mục kết quả mà không đọc all_responses đã lỗi thời.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- Python
- Star
- 228
- Fork
- 161
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của weaviate/weaviate-python-client
-
insert_many silently discards vectors if they're NumPy arraysCó thể đã có người làm @tibor-reiss đã nhận 822 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
weaviate/weaviate-python-client#1002 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Client-side batching: wholesale chunk failures are reported under chunk-local indices, so errors collide and describe the wrong objectsCó thể đã có người làm @feiiiiii5 đã nhận 30 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 15/100
weaviate/weaviate-python-client#2165 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[HTTPXodus] Consider migrating from httpx to httpx2 (the actively maintained fork)Có thể đã có người làm @ProgrammerPlus1998 đã nhận 45 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
weaviate/weaviate-python-client#2154 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fetch_objects(limit=0) returns a default page of objects instead of noneCó thể đã có người làm @databyjp đã nhận 4 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
weaviate/weaviate-python-client#2150 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Batch stream recovery closes the shared connection and can leave the client permanently closedCó thể làm lại được @g-despot đã nhận 57 ngày trước và không có pull request nào đang mở. Đang mởbug
weaviate/weaviate-python-client#2139 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của weaviate/weaviate-python-client
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
google-ai-edge/litert-torch#1346 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
geneontology/gocam-py#272 ·
-
pushed_authorization_request sends list authorization_details as a Python reprCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
auth0/auth0-python#903 ·
Maintainer thường phản hồi trong vòng 1 ngày