Search⌘ K
AI Features

Make Sync Calls Safe: Timeouts, Retries, Breakers, and Throttling

Timeouts, retries with backoff and jitter, circuit breakers, and throttling stop synchronous calls from turning latency spikes into outages. This hands-on lesson builds a bounded policy for storefront payment and inventory calls. Covers: Retry storms, timeout budgets, uncertain outcomes, retryable versus nonretryable errors, per-dependency circuit breakers, load shedding, saturation signals. Practice: Resilience controls. Prerequisites: Synchronous service-to-service calls.

A downstream latency spike can turn a checkout slowdown into an outage when clients respond by retrying every unfinished call. In the seasonal storefront, the web and API tier calls the payment service and inventory service synchronously. As payment latency rises, requests remain in flight longer, concurrent work accumulates, and clients send additional attempts before earlier attempts have completed.

That creates a feedback loop. More retries add load to an already degraded dependency, increased load worsens latency, and worse latency triggers still more retries. An interviewer listens for this mechanism, not the vague recommendation to “add retries.” A bounded policy sets both an attempt limit and a total time budget for one logical operation.

Inspect how timed-out calls and retries raise concurrent in-flight work during dependency degradation.

Timeouts and retries can amplify load during partial failures
Timeouts and retries can amplify load during partial failures
...