Reliabilityretriesretry policy

Retry

Definition

A retry re-sends an operation that failed with a transient error, according to a policy that sets which errors qualify, how many attempts are allowed and how long to wait between them.

In practice

Many failures are brief: a dropped connection, a leader election, a throttled request. A small number of retries hides these from users. Only retry errors that might succeed next time, and only operations that are idempotent.

Retries multiply load: three layers that each retry three times turn one failure into 27 calls on the struggling service. Cap attempts, add exponential backoff with jitter, use retry budgets and combine them with circuit breakers.

Example

A client retries a 503 from the inventory service up to 3 times with delays around 100, 200 and 400 ms, but never retries a 400.