Idle timeout occurs if same request object is reused to send request multiple times
Jetty Client version(s). 9.4.22.v20191022 and above
Java version/vendor (use: java -version). openjdk version "11.0.2" 2019-01-15
OS type/version macOS Big Sur
Description, Client gets Idle timeout error if the same Request object is reused to send request multiple times to the same destination. The same scenario works in 9.4.21.v20190926 and earlier versions.
The client could get response if different Request objects are created each time to send request.
How to reproduce? I have created a simple project to demonstrate the issue. You could see the error I described when running the JettySampleClient.java
Request objects are not reusable.
We should clarify this in the documentation.
Hi @sbordet , thanks for the quick response! It would be great if the document can be updated to describe this constraint. I came across this constraint when bumping up the jetty client version in my project. Just out of curiosity, is there any reason to have such a constraint as the older versions seem to work?Thanks!
is there any reason to have such a constraint as the older versions seem to work?
What older version are you referring to?
All releases of Jetty 9.x have had this constraint.
@sbordet lets tag the Request object as "used" or "dirty" and reject it with a clear error message if reused.
Hi @joakime , the old version i was referring to is 9.4.19.v20190610. The sample project I mentioned could reuse the same request object without any issue if the version is earlier than 9.4.22.v20191022. Client start to get Idle timeout error if version is 9.4.22.v20191022 or later.
The only differences in the Request and HttpRequest implementation between 9.4.19 and 9.4.42 is the addition of an optional tag to allow hooking into specific tagged connections on the connection pool.
The constraints we are talking about were present in Jetty 9.4.19 as well.
@sbordet be careful about running the demo project at https://github.com/dwen77/jetty-client-demo - change the URL to not be google.com, otherwise you'll be locked out of google "for excessive automation".
Thanks for explaining the details! Did you mange to see the different results when running different versions? or @sbordet will do that?
@sbordet @joakime are there documentation changes to be done here or code changes? If documentation, please assign to Chris, if code changes, a PR :)
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to it having no activity.