Configurable Call Timeout
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 341
- Forks
- 79
- Avg merge
- 12d 52m
- Merged PRs (30d)
- 2
Description
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-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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue identifies connections.connect-timeout, connections.socket-timeout, timeouts.global, and possible plugin or policy-composition approaches. Start by tracing how these timeout settings and request policies are configured; done means a complete HTTP call can receive its own timeout without being confused with connection, socket, or global retry timeouts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100