Batch: re-added rate-limited objects stay in results.objs.all_responses as errors
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
Línea de trabajo
Empieza en weaviate/collections/batch/base.py, en _BatchBase.__send_batch, y reprodúcelo con mock_tests/test_probe_readd_dep020.py usando los fixtures de gRPC simulados. Verifica que el retry elimine el ErrorObject obsoleto, no emita ninguna advertencia Dep020 y deje cuatro entradas de resultados sin leer el all_responses obsoleto.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- Python
- Estrellas
- 228
- Forks
- 158
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de weaviate/weaviate-python-client
-
insert_many silently discards vectors if they're NumPy arraysPosiblemente ocupada @tibor-reiss la tomó hace 820 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
weaviate/weaviate-python-client#1002 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Client-side batching: wholesale chunk failures are reported under chunk-local indices, so errors collide and describe the wrong objectsPosiblemente ocupada @feiiiiii5 la tomó hace 28 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 15/100
weaviate/weaviate-python-client#2165 ·
Los mantenedores suelen responder en 1 día
-
[HTTPXodus] Consider migrating from httpx to httpx2 (the actively maintained fork)Posiblemente ocupada @ProgrammerPlus1998 la tomó hace 43 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
weaviate/weaviate-python-client#2154 ·
Los mantenedores suelen responder en 1 día
-
fetch_objects(limit=0) returns a default page of objects instead of nonePosiblemente ocupada @databyjp la tomó hace 2 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
weaviate/weaviate-python-client#2150 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Batch stream recovery closes the shared connection and can leave the client permanently closedQuizá libre de nuevo @g-despot la tomó hace 55 días y no hay ningún pull request abierto. Abiertobug
weaviate/weaviate-python-client#2139 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de weaviate/weaviate-python-client
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
lidofinance/diffyscan#239 ·
Los mantenedores suelen responder en 1 día
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsAbiertoarea: tools documentation good first issue ready for a contributor
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
eyalgolan/statecraft-israel#873 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
GET rooms API returns 500 due to nonexistent Room.is_active attributePosiblemente ocupada @Mars-60 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Add cover art to song rowsAbiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 5 días
-
Harmony OPeNDAP SubSetter (HOSS) Geographic production rssmif16d 7 XYZ_PROV
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
nasa/harmony-autotester#341 ·