From 678517018ddfd21b202a94df13b06dfa1ab8a378 Mon Sep 17 00:00:00 2001 From: Weston Pace Date: Thu, 29 Aug 2024 09:35:00 -0700 Subject: [PATCH] docs[object_store]: clarify the backoff strategy that is actually implemented (#6325) * Clarify the backoff strategy that is actually implemented * Update object_store/src/client/backoff.rs Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> --------- Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> --- object_store/src/client/backoff.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/object_store/src/client/backoff.rs b/object_store/src/client/backoff.rs index e01589102eb1..a1fa26cde2e8 100644 --- a/object_store/src/client/backoff.rs +++ b/object_store/src/client/backoff.rs @@ -18,7 +18,12 @@ use rand::prelude::*; use std::time::Duration; -/// Exponential backoff with jitter +/// Exponential backoff with decorrelated jitter algorithm +/// +/// The first backoff will always be `init_backoff`. +/// +/// Subsequent backoffs will pick a random value between `init_backoff` and +/// `base * previous` where `previous` is the duration of the previous backoff /// /// See #[allow(missing_copy_implementations)] @@ -28,7 +33,7 @@ pub struct BackoffConfig { pub init_backoff: Duration, /// The maximum backoff duration pub max_backoff: Duration, - /// The base of the exponential to use + /// The multiplier to use for the next backoff duration pub base: f64, }