Connection and Response Timeouts

Connecting to an endpoint and receiving an application response are separate stages. A client can assign different time budgets to them.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a reachable listener
  2. Keep errors useful
  3. Place deadlines around separate observations
  4. Measure an overall deadline if the caller has one

Trace a reachable listener

A connection can open quickly while generating the requested report takes longer. A connection timeout only governs reaching the first state under the client API. Use a total deadline to account for both.

Keep errors useful

Record the stage, elapsed time, and intended service without copying sensitive request content. Diagnostic context captures enough information for an ordinary investigation.[1][2]

Place deadlines around separate observations

A client may spend time establishing a connection, then receive no response even though connection succeeded. A connection timeout covers a designated setup phase. A response deadline or inactivity limit covers later progress according to the specific client library. See command process timeouts.

Attempt A: connection never established → connect failure or timeout
Attempt B: established quickly, no reply → later deadline expires
Attempt C: reply starts, then stalls → check the progress policy

Measure an overall deadline if the caller has one

Multiple per-phase timers and retries can exceed a product-level budget. Use an explicit overall limit when required and record the phase of failure. Test each phase using a service fixture.

References

  1. Larry Peterson and Bruce Davie, Computer Networks: A Systems Approach ↩
  2. IETF, RFC 9110: HTTP Semantics ↩