zalando / zalando/riptide

Configurable Call Timeout

Open
#1,040 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Help Wanted
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-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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.