Repository navigation
fix(bedrock): cancelling an embed call stops the rest of the batch - #126
Merged
Merged
Conversation
cabljac
approved these changes
Nov 13, 2026
Upstream-PR: genkit-ai/genkit#6439 Co-authored-by: rootkiller6788 <221446036+rootkiller6788@users.noreply.github.com>
…t batch cancel Catch asyncio.CancelledError instead of BaseException around asyncio.wait and around the drain gather. - GeneratorExit no longer runs task.cancel() on a closed loop, which printed an extra "Event loop is closed" traceback. - KeyboardInterrupt and SystemExit raised during the drain are no longer replaced by the original CancelledError. The docstring now states that cancelling the caller cancels the whole batch, in-flight calls included.
…unded Also raise a CancelledError that came out of a call instead of returning it as a vector, and test in-flight cancel and caller timeouts.
hilariie
force-pushed
the
fix/bedrock-embedder-cancelled-batch
branch
from
December 1, 2026 10:08
c1e0999 to
1a6b0d2
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cancelling a Bedrock
embedcall now stops the documents that haven't been sent yet. Before, the batch kept running after the caller was gone: every queued document still went to InvokeModel and was billed, and the results were thrown away.Changes
Breaking changes
None.
Fixes #221. Port of genkit-ai/genkit#6439.