fix(a2a): stop a converter failure from stalling the A2A event stream - #1402
Open
copybara-service[bot] wants to merge 1 commit into
Open
fix(a2a): stop a converter failure from stalling the A2A event stream#1402copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
`StreamHandler.handleEvent` called `ResponseConverter.clientEventToEvent` with no guard, and nothing between it and the transport's read loop catches a runtime exception either: the a2a client's streaming dispatch catches only `A2AClientError`, the SSE listener catches only `JsonProcessingException`, and the JDK SSE subscriber runs `subscription.request(1)` only after the message consumer returns. So a throw during conversion left the stream with no further demand and no terminal signal - a hung `Flowable` rather than a failed one. Route runtime exceptions to `handleError`, which is what a transport error already uses, so the caller sees a failed stream instead of one that never ends. Reachable today: a peer `FilePart` whose `FileWithBytes.bytes` is not valid base64 makes `PartConverter` throw `IllegalArgumentException`. The new off-thread test reproduces the stall without this fix - the subscriber times out with no error and no completion - and both tests pass with it. PiperOrigin-RevId: 959494592
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.
fix(a2a): stop a converter failure from stalling the A2A event stream
StreamHandler.handleEventcalledResponseConverter.clientEventToEventwith noguard, and nothing between it and the transport's read loop catches a runtime
exception either: the a2a client's streaming dispatch catches only
A2AClientError, the SSE listener catches onlyJsonProcessingException, andthe JDK SSE subscriber runs
subscription.request(1)only after the messageconsumer returns. So a throw during conversion left the stream with no further
demand and no terminal signal - a hung
Flowablerather than a failed one.Route runtime exceptions to
handleError, which is what a transport erroralready uses, so the caller sees a failed stream instead of one that never ends.
Reachable today: a peer
FilePartwhoseFileWithBytes.bytesis not validbase64 makes
PartConverterthrowIllegalArgumentException. The newoff-thread test reproduces the stall without this fix - the subscriber times out
with no error and no completion - and both tests pass with it.