Skip to content

fix(a2a): stop a converter failure from stalling the A2A event stream - #1402

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_959494592
Open

fix(a2a): stop a converter failure from stalling the A2A event stream#1402
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_959494592

Conversation

@copybara-service

Copy link
Copy Markdown

fix(a2a): stop a converter failure from stalling the A2A event stream

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.

`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
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.

1 participant