Skip to content

#6949 Fix Netty streaming completion guard#7114

Open
arnabnandy7 wants to merge 1 commit into
aws:masterfrom
arnabnandy7:fix/netty-stream-completion
Open

#6949 Fix Netty streaming completion guard#7114
arnabnandy7 wants to merge 1 commit into
aws:masterfrom
arnabnandy7:fix/netty-stream-completion

Conversation

@arnabnandy7

Copy link
Copy Markdown

Motivation and Context

Fixes #6949.

NettyNioAsyncHttpClient could suppress a channel-inactive fallback error when STREAMING_COMPLETE_KEY was true but RESPONSE_COMPLETE_KEY was not yet true. For AsyncResponseTransformer.toPublisher(), observing the final HTTP content does not necessarily mean the caller-visible response publisher has received a terminal signal, so this could leave subscribers waiting indefinitely.

Modifications

Changed ResponseHandler.notifyIfResponseNotCompleted() to treat only RESPONSE_COMPLETE_KEY=true as sufficient proof that the response has completed.

Added a regression test covering the problematic state where streaming is marked complete, response finalization has not happened, and the channel becomes inactive. The test verifies that an IOException is surfaced, the execute future completes exceptionally, and the channel is released.

Added a changelog entry for the Netty NIO Async HTTP Client bug fix.

Testing

Ran:

.\mvnw.cmd -pl http-clients\netty-nio-client -Dtest=PublisherAdapterTest test

Result: passed, 6 tests.

Also ran:

.\mvnw.cmd -pl http-clients\netty-nio-client -am test

This failed before reaching the Netty module in core/annotations during SpotBugs.

Also ran:

.\mvnw.cmd -pl http-clients\netty-nio-client test

This failed due to unrelated local runtime/tooling issues: WireMock certificate generation was unsupported on this runtime, and JaCoCo reported Unsupported class file major version 70.

Ran:

git diff --check

Result: passed.

Screenshots (if appropriate)

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

License

  • I confirm that this pull request can be released under the Apache 2 license

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@arnabnandy7 arnabnandy7 requested a review from a team as a code owner July 8, 2026 09:54
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.

Netty async streaming response may miss terminal signal with AsyncResponseTransformer.toPublisher()

1 participant