I would like to be able to configure timeouts on a per request basis similar to what OkHttp calls Call Timeout (link).
Detailed Description
My current understanding is, that following request-related timeouts can be configured:
connections.connect-timeout for starting the TCP connection
connections.socket-timeout for data flow/ packets
timeouts.global wrapping everything (retries, queuing, backup requests, fallbacks, etc)
From my perspective, what is missing is a way to define a time limit for a complete HTTP call (only), including resolving DNS, connecting, writing the request body, server processing, as well as reading the response body. OkHttp calls this Call Timeout.
Context
Currently it appears to me that there are only super low-level or super high-level timeout configuration possibilities, which makes it hard to configure SLO-based timeouts. As upstream services often define latency objectives on a per-request basis, I would also like to configure my request timeouts on a per request basis.
To be more specific: I am neither interested in a particular connections.connect-timeout nor a specific connections.socket-timeout as long as the entire HTTP request finishes within a given time.
Unfortunately the timeouts.global is too global on the other hand because it spans multiple request, which means that configuring something like this...
clients:
example:
connections:
connect-timeout: 25 milliseconds
socket-timeout: 25 milliseconds
retry:
enabled: true
max-retries: 2
timeouts:
enabled: true
global: 150 milliseconds
... could still result in the global timeout kicking in before any retry happens.
Possible Implementation
- a per call timeout (maybe via a plugin)
- policy composition autoconfig possibilities
Your Environment
- Version used: 3.0.0-RC.15
- pretty standard Springboot app (2.3.7.RELEASE)
I would like to be able to configure timeouts on a per request basis similar to what OkHttp calls
Call Timeout(link).Detailed Description
My current understanding is, that following request-related timeouts can be configured:
connections.connect-timeoutfor starting the TCP connectionconnections.socket-timeoutfor data flow/ packetstimeouts.globalwrapping everything (retries, queuing, backup requests, fallbacks, etc)From my perspective, what is missing is a way to define a time limit for a complete HTTP call (only), including resolving DNS, connecting, writing the request body, server processing, as well as reading the response body. OkHttp calls this
Call Timeout.Context
Currently it appears to me that there are only super low-level or super high-level timeout configuration possibilities, which makes it hard to configure SLO-based timeouts. As upstream services often define latency objectives on a per-request basis, I would also like to configure my request timeouts on a per request basis.
To be more specific: I am neither interested in a particular
connections.connect-timeoutnor a specificconnections.socket-timeoutas long as the entire HTTP request finishes within a given time.Unfortunately the
timeouts.globalis too global on the other hand because it spans multiple request, which means that configuring something like this...... could still result in the global timeout kicking in before any retry happens.
Possible Implementation
Your Environment