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

Fixes #6514 - How to warm up SslConnection. #12151

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented Aug 8, 2024

Implemented "priming" of HTTP/1.1 connections using ConnectionPool.preCreateConnections(int) and HttpClientTransportOverHTTP.setInitializeConnections(true).

This sends OPTIONS * HTTP/1.1 to the server.

I tried to implement this feature by forcing a write of 0 bytes from the layer above SslConnection, but it did not work when using TLS because in both WriteFlusher and SslConnection the fact that there are 0 bytes left to write is treated specially.

Other HTTP versions have no problems because they must initialize the connection by e.g. sending a SETTINGS frame, so they would also initialize TLS.

Implemented "priming" of HTTP/1.1 connections using ConnectionPool.preCreateConnections(int) and HttpClientTransportOverHTTP.setInitializeConnections(true).

This sends `OPTIONS * HTTP/1.1` to the server.

I tried to implement this feature by forcing a write of 0 bytes from the layer above `SslConnection`, but it did not work when using TLS because in both WriteFlusher and SslConnection the fact that there are 0 bytes left to write is treated specially.

Other HTTP versions have no problems because they must initialize the connection by e.g. sending a SETTINGS frame, so they would also initialize TLS.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet requested review from gregw and lorban August 8, 2024 17:12
@sbordet sbordet linked an issue Aug 8, 2024 that may be closed by this pull request
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet requested a review from gregw August 19, 2024 09:06
gregw
gregw previously approved these changes Aug 19, 2024
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The javadoc really should be on the public class that users will interact with, not only on the internal class. Other than that OK, so I'll give the green tick but please fix.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet
Copy link
Contributor Author

sbordet commented Aug 20, 2024

@gregw fixed.

@sbordet sbordet merged commit 942e77c into jetty-12.0.x Aug 20, 2024
2 of 4 checks passed
@sbordet sbordet deleted the fix/jetty-12.0.x/6514/pre-create-connections branch August 20, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

How to warm up SslConnection
2 participants