fix(core): preserve ordering in RunnableRetry batch/abatch results #32526
+87
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description: Fixes a bug in RunnableRetry where .batch / .abatch could return misordered outputs (e.g. inputs [0,1,2] yielding [1,1,2]) when some items succeeded on an earlier attempt and others were retried. Root cause: successful results were stored keyed by the index within the shrinking “pending” subset rather than the original input index, causing collisions and reordered/duplicated outputs after retries. Fix updates _batch and _abatch to:
Issue: Fixes #21326
Tests:
Dependencies: