Skip to content

JettyClientHttpRequestFactory should set request/response timeout #32330

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

Closed
rroesch1 opened this issue Feb 26, 2024 · 0 comments · Fixed by venktre/spring-frame-project#1
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@rroesch1
Copy link

Affects: Spring Framework 6.1


The JettyClientHttpRequestFactory has a readTimeout (defaults to 10s) to limit the duration of org.eclipse.jetty.client.InputStreamResponseListener#get calls.
(note: The wait on this method ends as soon as all HTTP headers have been received. It does not limit the time for the response body transmission.).

But even if the timeout limit has reached, Jetty still continues to wait for the response or, in case the request has been queued, the Request may still remain in the Jetty request queue. Thus these requests may block connections for an indefinite amount of time. In a worst case scenario (i.e. there are a lot of very slow queries) all available connections for a destination (org.eclipse.jetty.client.HttpClient#setMaxConnectionsPerDestination, defaults to 64) may get blocked by these dangling requests.

JettyClientHttpRequestFactory should set the request/response timeout (org.eclipse.jetty.client.Request#timeout) to make sure that requests get "aborted"/"de-queued" when the application no longer expects a response. The default value for Request#timeout is 0 which means it waits indefinitely.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 26, 2024
@rstoyanchev rstoyanchev added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Mar 19, 2024
@bclozel bclozel changed the title JettyClientHttpRequestFactory should set request/response timeout JettyClientHttpRequestFactory should set request/response timeout Apr 17, 2024
@poutsma poutsma self-assigned this Apr 30, 2024
@poutsma poutsma added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 1, 2024
@poutsma poutsma added this to the 6.2.0-M2 milestone May 1, 2024
@poutsma poutsma closed this as completed in 37dd47c May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
4 participants