Skip to content

Fix streaming timeout exception decoration#6975

Open
adwantg wants to merge 1 commit into
aws:masterfrom
adwantg:fix/aws-sdk-java-v2-6866-streaming-timeout
Open

Fix streaming timeout exception decoration#6975
adwantg wants to merge 1 commit into
aws:masterfrom
adwantg:fix/aws-sdk-java-v2-6866-streaming-timeout

Conversation

@adwantg
Copy link
Copy Markdown

@adwantg adwantg commented May 16, 2026

Motivation and Context

Fixes #6866.

For streamed S3AsyncClient#getObject responses, Netty can surface ReadTimeoutException through ResponseHandler.PublisherAdapter.onError. That path was forwarding the raw Netty exception, unlike the exceptionCaught path, so the SDK retry path could miss the decorated IOException.

Modifications

  • Decorate publisher errors with NettyUtils.decorateException before notifying the downstream subscriber and response handler.
  • Add a regression test for the streamed publisher error path.
  • Add a changelog entry for the Netty NIO HTTP Client.

Testing

  • ./mvnw -pl :netty-nio-client -am -Dtest=PublisherAdapterTest#streamingReadTimeout_shouldDecorateExceptionBeforeNotifyingHandlers -Dsurefire.failIfNoSpecifiedTests=false -Dspotbugs.skip=true -Dcheckstyle.skip=true test
  • ./mvnw -pl :netty-nio-client -am -Dtest=PublisherAdapterTest -Dsurefire.failIfNoSpecifiedTests=false -Dspotbugs.skip=true -Dcheckstyle.skip=true test

I also attempted the broader netty module test command:

  • ./mvnw -pl :netty-nio-client -am -Dsurefire.failIfNoSpecifiedTests=false -Dspotbugs.skip=true -Dcheckstyle.skip=true test

That broader local run reached the netty client suite but failed in ServerConnectivityErrorMessageTest.closeTimeHasCorrectMessage on my JDK 21 environment because two local socket-close cases reported Connection reset. The touched PublisherAdapterTest class 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

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

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

@adwantg adwantg requested a review from a team as a code owner May 16, 2026 06:15
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.

io.netty.handler.timeout.ReadTimeoutException not getting retried for S3AsyncClient::getObject

1 participant