Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combines prologue and headers into a single write in WebClient #9842

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

spericas
Copy link
Member

@spericas spericas commented Feb 26, 2025

Description

Combines prologue and headers into a single write to prevent potential TCP delays when using TLS. With TLS, each write becomes a record and a small record can be delayed due to Nagle's algorithm. See #9839.

This problem appears to only impact the WebClient with TLS and output streams (e.g. when used via the Helidon connector). Every small write to the output stream is turned into a TLS record, encrypted and written to the socket. When small packets (such as just the HTTP prologue without headers) are written, it can result in delays due to Nagle's algorithm. Turning on TPC_NO_DELAY can help, but it may not be the ideal solution in all environments.

Writting a unit test for this PR is just awkward: would require lots of mocking and also exposing several private methods. Simply passing all the existing pipeline tests should be proof that the change is sound.

Documentation

None

@spericas spericas added webclient 4.x Version 4.x labels Feb 26, 2025
@spericas spericas added this to the 4.2.1 milestone Feb 26, 2025
@spericas spericas self-assigned this Feb 26, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 26, 2025
@spericas spericas marked this pull request as draft February 26, 2025 19:45
…l TCP delays when using TLS. With TLS, each write becomes a record and a small record can be delayed due to Nagle's algorithm.
@spericas spericas marked this pull request as ready for review February 27, 2025 16:09
@spericas spericas merged commit 25bc0ed into helidon-io:main Feb 27, 2025
62 checks passed
@spericas spericas mentioned this pull request Feb 27, 2025
@barchetta barchetta mentioned this pull request Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x OCA Verified All contributors have signed the Oracle Contributor Agreement. performance webclient
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants