Retry configuration for the retry: node option.
Attempts retry on exceptions only — {:error, term} return values are
ordinary node results and are never retried. Delays grow exponentially
and are capped:
delay = min(max_interval_ms, initial_interval_ms * backoff_factor^(attempt - 1))With jitter: true (the default) up to 10% random delay is added so
simultaneous retries do not stampede a recovering dependency.
Options
:max_attempts— total attempts including the first (default 3):initial_interval_ms— delay before the first retry (default 100);:backoff_msis accepted as a legacy alias:backoff_factor— exponential growth factor (default 2.0):max_interval_ms— delay ceiling (default 30_000):jitter— add up to 10% random delay (defaulttrue):retryable?—(exception -> boolean)filter (default: retry all)
Summary
Functions
Delay in milliseconds before retrying after the given failed attempt.
Normalizes the retry: node option into a policy map.
Types
@type t() :: %{ max_attempts: pos_integer(), initial_interval_ms: non_neg_integer(), backoff_factor: number(), max_interval_ms: pos_integer(), jitter: boolean(), retryable?: (Exception.t() -> boolean()) }
Functions
@spec delay_ms(t(), pos_integer()) :: non_neg_integer()
Delay in milliseconds before retrying after the given failed attempt.
Normalizes the retry: node option into a policy map.