JettyClientHttpRequestFactory should set request/response timeout #32330
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Affects: Spring Framework 6.1
The
JettyClientHttpRequestFactory
has areadTimeout
(defaults to10s
) to limit the duration oforg.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 to64
) 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 forRequest#timeout
is0
which means it waits indefinitely.The text was updated successfully, but these errors were encountered: