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

Fixes InputStreamResponseListener should have a read timeout #7259

Open sbordet opened this issue 3 years ago • 9 comments

Added constructor with read timeout parameter. Updated implementation to honor the read timeout. Added test case.

Signed-off-by: Simone Bordet [email protected]

sbordet avatar Dec 10 '21 17:12 sbordet

This looks redundant with the idle timeout mechanism to me. What's this bringing that idleTimeout cannot do, or what am I missing?

lorban avatar Dec 13 '21 09:12 lorban

@lorban the idle timeout of the ClientConnector cannot be accessed from this class.

I can use that of the request by default, but only if it has been set by the application.

sbordet avatar Dec 13 '21 10:12 sbordet

Do you want this in upcoming 9.4.45 release too?

joakime avatar Dec 14 '21 12:12 joakime

@joakime yes please

sbordet avatar Dec 14 '21 14:12 sbordet

@sbordet my point isn't where to get the timeout value from, but rather than the idleTimeout mechanism should be the only one that unblocks the awaiting thread after a certain time elapsed, at least IMHO.

Adding an extra timeout looks to me like replicating an existing feature just in case that said feature doesn't work as expected.

lorban avatar Dec 14 '21 15:12 lorban

@gregw thoughts?

sbordet avatar Dec 14 '21 17:12 sbordet

@lorban what project do you want this PR in? (10.0.10?)

joakime avatar Apr 05 '22 16:04 joakime

@sbordet I'm with @lorban on this? Why is there a second timer? If I understand correctly there is a HttpClient request, that will have one idle timeout, then a listener that can have another. So without this PR, a user can make a HttpClient request and start reading from the input stream listener. They will block waiting for content and if the HttpClient request timesout, then their input stream will fail accordingly. With this PR, the input stream may timeout before the HttpClient has? This makes no sense to me?

Without the second timeout, is there ever a case this listener will wait forever for the HttpClient to succeed or fail? The issue only says:

his is sub-optimal because there is a risk that the caller thread waits forever

But surely that would be a bug in HttpClient?

gregw avatar Apr 06 '22 07:04 gregw

@sbordet bump what's the status on this?

joakime avatar Jun 28 '22 19:06 joakime

I think this should be closed. @sbordet?

gregw avatar Sep 02 '22 04:09 gregw

Closing this but leaving the issue open.

sbordet avatar Sep 05 '22 09:09 sbordet