Retry policy for transient Azure failures.
Retries on HTTP 408, 429, and 5xx responses with exponential backoff.
Summary
Functions
Sleeps for the computed backoff duration and emits retry telemetry.
Returns the default retry policy.
Computes the backoff delay in milliseconds for a given attempt number.
Returns true when the response should be retried.
Types
@type policy() :: %{ max_attempts: pos_integer(), base_delay_ms: pos_integer(), max_delay_ms: pos_integer() }
Functions
@spec backoff(policy(), pos_integer(), map()) :: :ok
Sleeps for the computed backoff duration and emits retry telemetry.
@spec default_policy() :: %{max_attempts: 3, base_delay_ms: 200, max_delay_ms: 5000}
Returns the default retry policy.
@spec delay_ms(policy(), pos_integer()) :: non_neg_integer()
Computes the backoff delay in milliseconds for a given attempt number.
@spec retryable?(AzureSDK.Core.Response.t()) :: boolean()
Returns true when the response should be retried.