pub struct RetrySettings {
pub n_attempts: Option<u32>,
pub n_warn_attempts: Option<u32>,
pub min_backoff: Duration,
pub max_backoff: Duration,
pub backoff_jitter_pct: u8,
pub attempt_reset_after_backoff_multiples: u32,
}Expand description
Controls retry attempt limits, telemetry escalation thresholds, and exponential backoff behaviour.
Use RetrySettings::n_warn_attempts to decide how many failures remain WARN events before
escalation. Set it to None to keep every retry at WARN.
Fields§
§n_attempts: Option<u32>Maximum number of consecutive attempts before the job is failed for good. None retries
indefinitely.
n_warn_attempts: Option<u32>Number of consecutive failures that can be emitted as WARN telemetry before the crate
promotes subsequent failures to ERROR. None disables escalation and keeps every retry
at WARN.
min_backoff: DurationSmallest backoff duration when rescheduling failures. Acts as the base for exponential backoff growth.
max_backoff: DurationMaximum backoff duration. Once the exponentially increasing delay reaches this value it will stop growing.
backoff_jitter_pct: u8Percentage (0-100) jitter applied to the computed backoff window to avoid thundering herds.
attempt_reset_after_backoff_multiples: u32Multiplier applied to the previous backoff window. Once the elapsed time since the last
scheduled run exceeds previous_backoff * attempt_reset_after_backoff_multiples, the job is
treated as healthy again and the attempt counter resets to 1.
Implementations§
Source§impl RetrySettings
impl RetrySettings
pub fn repeat_indefinitely() -> Self
Trait Implementations§
Source§impl Clone for RetrySettings
impl Clone for RetrySettings
Source§fn clone(&self) -> RetrySettings
fn clone(&self) -> RetrySettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetrySettings
impl Debug for RetrySettings
Auto Trait Implementations§
impl Freeze for RetrySettings
impl RefUnwindSafe for RetrySettings
impl Send for RetrySettings
impl Sync for RetrySettings
impl Unpin for RetrySettings
impl UnsafeUnpin for RetrySettings
impl UnwindSafe for RetrySettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more