Skip to main content

Module retry

Module retry 

Source
Expand description

Retry helpers for target-side and server-side rotation steps.

Structsยง

RetryCfg ๐Ÿ”’
Configuration for the retry helpers.

Enumsยง

GatedOutcome ๐Ÿ”’
The outcome of a with_retries_gated call.

Functionsยง

cap_to_deadline ๐Ÿ”’
Truncate delay so it does not push past deadline, or None once the deadline has passed.
exponential_delay ๐Ÿ”’
base * 2^attempt for a 0-indexed attempt, capped at 32x to avoid overflow.
retry_loop ๐Ÿ”’
The shared retry loop: gate before each try, then op, sleeping between transient failures.
with_retries ๐Ÿ”’
Retry op with exponential backoff. Retry::Permanent returns at once; Retry::Transient retries until the tries run out or deadline passes, with sleeps truncated to it.
with_retries_gated ๐Ÿ”’
Like with_retries, but awaits gate() before every try; an abort returns GatedOutcome::Aborted. Session loss or lease expiry stops target-side steps between tries, never mid-call. Sleeps are not capped to a deadline: the gate checks execute_by before the next try.