Skip to content

fix(batch): remove stale error after rate-limited re-add - #2260

Open
feiiiiii5 wants to merge 1 commit into
weaviate:mainfrom
feiiiiii5:fix/batch-stale-readd-error
Open

feiiiiii5 wants to merge 1 commit into
weaviate:mainfrom
feiiiiii5:fix/batch-stale-readd-error

Conversation

@feiiiiii5

Copy link
Copy Markdown

Fixes #2179.

What changes

BatchObjectReturn.errors is keyed by the object's original index, but the rate-limit re-add path filtered _all_responses by its list position. From the second chunk onward those two numbers differ, so the re-added object's ErrorObject stayed in _all_responses after its retry succeeded, while a successful object's entry was dropped instead. The same line read the deprecated all_responses property, so a batch that never touched the deprecated attribute still emitted Dep020.

  • Map the re-added errors back to their position in the current request before filtering _all_responses.
  • Read _all_responses directly instead of going through the deprecated property.
  • Add a mock gRPC regression test: four objects, batch_size=2, the first object of the second chunk rate-limited once.

Testing

  • The new test fails on main: the retried object's ErrorObject is still in _all_responses (assert False), and Dep020 is emitted. It passes with the change.
  • mock_tests/test_batch.py: 6 passed.
  • Ruff lint and format are clean for both changed files.
  • The gRPC path was exercised through the mock server only; no live Weaviate server was run.

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot

Copy link
Copy Markdown

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Batch: re-added rate-limited objects stay in results.objs.all_responses as errors

2 participants