jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

Idle timeout occurs if same request object is reused to send request multiple times

Open dwen77 opened this issue 4 years ago • 9 comments

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

dwen77 avatar Jul 07 '21 07:07 dwen77

Request objects are not reusable.

We should clarify this in the documentation.

sbordet avatar Jul 07 '21 09:07 sbordet

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!

dwen77 avatar Jul 07 '21 10:07 dwen77

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.

joakime avatar Jul 07 '21 11:07 joakime

@sbordet lets tag the Request object as "used" or "dirty" and reject it with a clear error message if reused.

joakime avatar Jul 07 '21 11:07 joakime

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.

dwen77 avatar Jul 07 '21 11:07 dwen77

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".

joakime avatar Jul 07 '21 12:07 joakime

Thanks for explaining the details! Did you mange to see the different results when running different versions? or @sbordet will do that?

dwen77 avatar Jul 07 '21 12:07 dwen77

@sbordet @joakime are there documentation changes to be done here or code changes? If documentation, please assign to Chris, if code changes, a PR :)

janbartel avatar Jul 28 '21 00:07 janbartel

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.

github-actions[bot] avatar Aug 03 '22 00:08 github-actions[bot]

This issue has been closed due to it having no activity.

github-actions[bot] avatar Sep 02 '22 00:09 github-actions[bot]