pub struct SupervisionPolicy {
pub restart_backoff_initial: Duration,
pub restart_backoff_max: Duration,
pub restart_backoff_multiplier: NonZeroU32,
pub restart_window: Duration,
pub max_restarts_per_window: NonZeroU32,
pub stop_grace: Duration,
}Expand description
The operator-configured restart discipline for managed workers.
Fields§
§restart_backoff_initial: DurationDelay before the FIRST restart in a window.
restart_backoff_max: DurationCeiling the geometric backoff is clamped to.
restart_backoff_multiplier: NonZeroU32Geometric growth factor applied per restart already made in the window.
restart_window: DurationSliding window over which restarts are counted.
max_restarts_per_window: NonZeroU32Restarts permitted within one window before the instance is failed.
stop_grace: DurationGrace given to each of SIGTERM and SIGKILL when stopping a group.
Implementations§
Source§impl SupervisionPolicy
impl SupervisionPolicy
Sourcepub fn backoff_after(&self, restarts_in_window: u32) -> Duration
pub fn backoff_after(&self, restarts_in_window: u32) -> Duration
The delay owed before a restart, given how many restarts already happened inside the current window.
restarts_in_window counts the restarts already made, so the first
restart of a window (0 prior) waits exactly
restart_backoff_initial. Growth is geometric and saturating, and the
result is always clamped to restart_backoff_max.
Trait Implementations§
Source§impl Clone for SupervisionPolicy
impl Clone for SupervisionPolicy
Source§fn clone(&self) -> SupervisionPolicy
fn clone(&self) -> SupervisionPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SupervisionPolicy
Source§impl Debug for SupervisionPolicy
impl Debug for SupervisionPolicy
impl Eq for SupervisionPolicy
Source§impl PartialEq for SupervisionPolicy
impl PartialEq for SupervisionPolicy
impl StructuralPartialEq for SupervisionPolicy
Auto Trait Implementations§
impl Freeze for SupervisionPolicy
impl RefUnwindSafe for SupervisionPolicy
impl Send for SupervisionPolicy
impl Sync for SupervisionPolicy
impl Unpin for SupervisionPolicy
impl UnsafeUnpin for SupervisionPolicy
impl UnwindSafe for SupervisionPolicy
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request