-
Notifications
You must be signed in to change notification settings - Fork 565
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
4.0.0: WebClient HTTP keep-alive support appears to be broken #8077
Comments
@romain-grecourt came up with this patch and appears to fix the issue. But it needs further review for correctness: diff --git a/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1ClientResponseImpl.java b/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1ClientResponseImpl.java
index 16d4edc47b..3af52f6187 100644
--- a/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1ClientResponseImpl.java
+++ b/webclient/http1/src/main/java/io/helidon/webclient/http1/Http1ClientResponseImpl.java
@@ -160,6 +160,8 @@ class Http1ClientResponseImpl implements Http1ClientResponse {
try {
if (headers().contains(HeaderValues.CONNECTION_CLOSE)) {
connection.closeResource();
+ } else if (headers().contains(HeaderValues.CONNECTION_KEEP_ALIVE)) {
+ connection.releaseResource();
} else {
if (entityLength == 0) {
connection.releaseResource(); |
barchetta
changed the title
4.0.1: WebClient HTTP keep-alive support appears to be broken
4.0.0: WebClient HTTP keep-alive support appears to be broken
Nov 27, 2023
I had seen this in H3 but failed to report it since I found the Ning HTTP client to meet all our requirements out of the box. Consider backporting this to H3 as well |
danielkec
added a commit
to danielkec/helidon
that referenced
this issue
Dec 4, 2023
danielkec
added a commit
to danielkec/helidon
that referenced
this issue
Dec 4, 2023
danielkec
added a commit
to danielkec/helidon
that referenced
this issue
Dec 5, 2023
danielkec
added a commit
to danielkec/helidon
that referenced
this issue
Dec 5, 2023
danielkec
added a commit
to danielkec/helidon
that referenced
this issue
Dec 7, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment Details
Problem Description
The Helidon 4 WebClient HTTP keep-alive support appears to be broken. Even with
keepAlive(true)
the client does not reuse connections.Steps to reproduce
See the attached test case: client.zip
This is based on the stand-alone webclient example that has been modified to set
keepAlive(true)
and to perform 10 GET requests sequentially. After the test is run (see README) netstat shows 10 connections in TIME_WAIT instead of one:The text was updated successfully, but these errors were encountered: