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.