-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
HttpClient idleTimeout configuration being ignored/overridden #7993
Comments
#8635 is related, but for the SOCKS proxy. |
…ridden The problem was that the timeout scheduling was not happening, because for TunnelRequest the timeouts were set in normalizeRequest(), which runs after the scheduling. Now a call to request.sent() is made also after normalizeRequest() so that the timeouts is scheduled (if it was not scheduled before). Signed-off-by: Simone Bordet <[email protected]>
@cotej I have a fix in branch |
Hi @sbordet - I built the branch and did some quick testing... It seems to fix the client's idleTimeout being ignored, but causes a new problem where the request's idleTimeout now gets ignored. Using the same test setup with a server that responds after 20s, here's a quick summary of what I'm seeing:
|
…ridden The problem was that the timeout scheduling was not happening, because for TunnelRequest the timeouts were set in normalizeRequest(), which runs after the scheduling. Now a call to request.sent() is made also after normalizeRequest() so that the timeouts is scheduled (if it was not scheduled before). Signed-off-by: Simone Bordet <[email protected]>
…ridden Fixed timeout handling. Signed-off-by: Simone Bordet <[email protected]>
@cotej I pushed updated code on the same branch, can you please try again? |
@sbordet It seems much better now with the latest changes 👍 Here's the scenarios I checked, and I'm now getting the expected results in all cases.
|
@cotej thanks for confirming! 👍🏼 |
#8672) * Fixes #7993 - HttpClient idleTimeout configuration being ignored/overridden The problem was that the timeout scheduling was not happening, because for TunnelRequest the timeouts were set in normalizeRequest(), which runs after the scheduling. Now a call to request.sent() is made also after normalizeRequest() so that the timeouts is scheduled (if it was not scheduled before). Signed-off-by: Simone Bordet <[email protected]>
Just a note--the issue says that:
But I'm able to replicate in |
@xiongtx this issue is fixed in Jetty 10+, so consider upgrading. |
Jetty version(s)
jetty-client 10.0.9
Java version/vendor
java version "11.0.11" 2021-04-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.11+9-LTS-194)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.11+9-LTS-194, mixed mode)
OS type/version
macOS Monterey 12.3.1
Description
The
idleTimeout
configuration that's set on anHttpClient
is ignored when making a request to an HTTPS destination via a proxy.How to reproduce?
Consider this example:
Result:
In this example, the server that's running at
https://example.webaddress.com:3000
is configured to wait 20 seconds before sending its response, in order to exercise idling the connection.The
HttpClient
has been configured to have an idle timeout of 30 seconds and there is no idle timeout being configured directly on the request itself, however aTimeoutException
ends up occuring and clearly showsIdle timeout 10000 ms
.It's worth pointing out that this only happens for these specific set of conditions (going through a proxy, to an HTTPS endpoint). i.e.
idleTimeout
on the request itself (commented line in the example), it works as expected and the request succeeds.So, where is this
10000 ms
timeout coming from? Seems to be this:https://github.com/eclipse/jetty.project/blob/b47d9c41d7b9ecc90844be545f2aee618447419e/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpConnectionOverHTTP.java#L305
It seems rather intentional, so I'm not certain this is necessarily a bug, but at the very least it seems that this behaviour is very non-obvious and non-documented.
The text was updated successfully, but these errors were encountered: