retry

Re-attempting a failed operation, usually with exponential backoff and a maximum attempt count.

Definition

A retry re-runs a failed operation in the hope it will succeed the next time — typical for transient failures like network blips, rate limits, or upstream downtime. Production retry logic uses exponential backoff (1s, 2s, 4s, 8s...), jitter to avoid thundering herds, a max attempt count, and a dead-letter queue for permanent failures. Retries only make sense when the target is idempotent.

When to use

Wrap any call to an external API, a queue consumer, or a webhook receiver in retry logic. Skip retries when the operation has irreversible side effects and isn't idempotent.

See also

Mentioned in