pub enum JitterMode {
None,
Full,
}Expand description
How to jitter an exponential backoff delay before sleeping.
The industry-standard approach for reconnect loops (Marc Brooker,
AWS Architecture Blog) is “full jitter”: sleep for a uniformly
random duration in [0, exp_backoff] rather than sleeping for
exactly exp_backoff. This breaks synchronized reconnect waves
across many clients and keeps the cluster’s recovery time tight
even when a partition heals for everyone at once.
Zero ships with one CLI per operator, so the “thundering herd” is thin, but the cost of jitter is zero and the story stays consistent across hosted deployments.
Variants§
None
Sleep for exactly exp_backoff. Deterministic; intended for
tests that need to assert exact reconnect timing.
Full
Sleep for rand_uniform(0, exp_backoff) — the “full jitter”
variant. Default for production.
Trait Implementations§
Source§impl Clone for JitterMode
impl Clone for JitterMode
Source§fn clone(&self) -> JitterMode
fn clone(&self) -> JitterMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more