pub struct JoinRetryPolicy {
pub max_attempts: u32,
pub max_backoff_secs: u64,
}Expand description
Tunable retry policy for the join loop.
The schedule is computed by halving from the configured ceiling:
for max_attempts = 8 and max_backoff_secs = 32, the per-attempt
delays are 0.25 s, 0.5 s, 1 s, 2 s, 4 s, 8 s, 16 s, 32 s — i.e.
each delay is max_backoff_secs >> (max_attempts - attempt). This
keeps the formula obvious from a single number while preserving
exponential growth.
Defaults match the production schedule. Tests construct their own
policy with a much smaller max_backoff_secs so the integration
suite doesn’t pay a ~minute backoff on every join failure path.
Fields§
§max_attempts: u32Number of join attempts before the loop gives up.
max_backoff_secs: u64Cap on the per-attempt backoff delay, in seconds. The schedule is derived from this ceiling — see the struct doc comment.
Implementations§
Source§impl JoinRetryPolicy
impl JoinRetryPolicy
Sourcepub fn backoff_for(&self, attempt: u32) -> Duration
pub fn backoff_for(&self, attempt: u32) -> Duration
Backoff delay before attempt (1-indexed). Attempt 0 is the
initial try and never sleeps. Returns Duration::ZERO for
out-of-range attempts.
Trait Implementations§
Source§impl Clone for JoinRetryPolicy
impl Clone for JoinRetryPolicy
Source§fn clone(&self) -> JoinRetryPolicy
fn clone(&self) -> JoinRetryPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JoinRetryPolicy
impl Debug for JoinRetryPolicy
Source§impl Default for JoinRetryPolicy
impl Default for JoinRetryPolicy
impl Copy for JoinRetryPolicy
Auto Trait Implementations§
impl Freeze for JoinRetryPolicy
impl RefUnwindSafe for JoinRetryPolicy
impl Send for JoinRetryPolicy
impl Sync for JoinRetryPolicy
impl Unpin for JoinRetryPolicy
impl UnsafeUnpin for JoinRetryPolicy
impl UnwindSafe for JoinRetryPolicy
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> 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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.