You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BedrockRuntimeAsyncClient.invokeModelWithResponseStream swallowed the exception that being throw by Visitor #4929
We are hitting this at production scale on ConverseStream, and can add three things to the report: this happens without the developer throwing, we have wire-level proof of the mechanism, and AWS support has independently confirmed the service-side half.
The swallow does not require the developer to throw from their own Visitor. Our visitor callbacks are individually wrapped in a catch, yet we still see the failure signature about 150 times per night: SequentialSubscriber's cancel fires between one decoded event and its delivery, so the throwable appears to originate inside the SDK's own delivery pipeline (flatMapIterable chain or demand handling), not user code.
HTTP/2 frame captures show the full consequence chain: the catch in SequentialSubscriber.onNext cancels the h2 stream (RST_STREAM errorCode=8 CANCEL), remaining events including messageStop and metadata are discarded, EventStreamAsyncResponseTransformer.handleOnStreamCancel completes the operation future successfully, and the cause is lost in the CompletableFuture that DefaultEventStreamResponseHandlerBuilder.subscriber(Consumer) constructs inline and discards. From the caller's perspective the operation succeeded and the response is simply truncated.
We opened an AWS support case on the Bedrock side and asked them to check their send-side records for the affected request IDs. They confirmed independently: on every failing call they checked, Bedrock generated and transmitted the complete response, terminal frames included, with no network error. That rules out a service-side or network-side cause and narrows this to the SDK delivery path. Happy to put the SDK team in touch with that case if useful.
Environment: aws-sdk-java 2.52.1, NettyNio, Bedrock ConverseStream with tools, anthropic.claude-sonnet-4-6, ECS Fargate. Failing responses share one shape: a tool_use content block whose entire streamed input is empty (one delta with an empty string, then
contentBlockStop), under concurrent load on a shared HTTP/2 connection. Redacted frame logs for a failing and a healthy stream on the same connection are available on request.
Beyond surfacing the exception, please also make sure the operation future does not complete successfully when the stream was cancelled by a delivery failure; that combination is what made this undiagnosable for weeks.
Activity
bhuvangu commentedon Sep 7, 2025
Facing the same issue. Below is Java code to reproduce:
Expected the onError to be called
bhuvangu commentedon Sep 9, 2025
Its been long this issue is open
debora-ito commentedon Aug 7, 2026
Yes, it's been a long time with no updates, I apologize for that.
We see the issue, the call should complete exceptionally in this case, We'll investigate a way to surface the exceptions.
brigidmulligan commentedon Aug 21, 2026
We are hitting this at production scale on
ConverseStream, and can add three things to the report: this happens without the developer throwing, we have wire-level proof of the mechanism, and AWS support has independently confirmed the service-side half.SequentialSubscriber's cancel fires between one decoded event and its delivery, so the throwable appears to originate inside the SDK's own delivery pipeline (flatMapIterablechain or demand handling), not user code.SequentialSubscriber.onNextcancels the h2 stream (RST_STREAMerrorCode=8 CANCEL), remaining events includingmessageStopandmetadataare discarded,EventStreamAsyncResponseTransformer.handleOnStreamCancelcompletes the operation future successfully, and the cause is lost in theCompletableFuturethatDefaultEventStreamResponseHandlerBuilder.subscriber(Consumer)constructs inline and discards. From the caller's perspective the operation succeeded and the response is simply truncated.Environment: aws-sdk-java 2.52.1, NettyNio, Bedrock ConverseStream with tools, anthropic.claude-sonnet-4-6, ECS Fargate. Failing responses share one shape: a tool_use content block whose entire streamed input is empty (one delta with an empty string, then
contentBlockStop), under concurrent load on a shared HTTP/2 connection. Redacted frame logs for a failing and a healthy stream on the same connection are available on request.
Beyond surfacing the exception, please also make sure the operation future does not complete successfully when the stream was cancelled by a delivery failure; that combination is what made this undiagnosable for weeks.