Skip to content

Fix OneTimeReadTimeoutHandler removed by TLS handshake for 100-contin…#6803

Open
zoewangg wants to merge 1 commit intomasterfrom
zoewang/expect100Continue
Open

Fix OneTimeReadTimeoutHandler removed by TLS handshake for 100-contin…#6803
zoewangg wants to merge 1 commit intomasterfrom
zoewang/expect100Continue

Conversation

@zoewangg
Copy link
Contributor

…ue requests

Motivation and Context

OneTimeReadTimeoutHandler was added at the front of the pipeline via addFirst, placing it before SslHandler. During the TLS handshake on new connections, raw encrypted bytes arrived as channelRead events and caused the handler to remove itself before the HTTP 100 Continue response could arrive. This left no read timeout handler active, causing requests with Expect: 100-continue to hang indefinitely when no response is received.

Modifications

  • Changed OneTimeReadTimeoutHandler pipeline position from addFirst to addBefore(HttpStreamsClientHandler) in NettyRequestExecutor.writeRequest(), so the handler only sees decoded HTTP messages and is not affected by TLS handshake data
  • Added Expect100ContinueReadTimeoutTest — an integration test with a slow-handshake TLS server that never responds to 100-continue. The test hangs without the fix and passes with it.

Testing

  • Expect100ContinueReadTimeoutTest — verified it fails (hangs) pre-fix and passes post-fix

  • Existing tests pass

  • Added unit tests

  • Ran existing tests

  • Manual testing performed

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 clean install -pl :netty-nio-client 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
  • 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

@zoewangg zoewangg requested a review from a team as a code owner March 18, 2026 17:40
@sonarqubecloud
Copy link

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