From 9cdccae49d605bf9b3f2a184e1adb92822de9670 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Fri, 24 Sep 2021 16:57:45 -0400 Subject: [PATCH] fix: Actually do the exponential part of exponential backoff --- object_store/src/aws.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/object_store/src/aws.rs b/object_store/src/aws.rs index f8f81a622c..f282656204 100644 --- a/object_store/src/aws.rs +++ b/object_store/src/aws.rs @@ -477,9 +477,8 @@ where H: Future>> + Send, { let mut attempts = 0; - // TODO: configurable + // TODO: make the number of retries configurable let n_retries = 10; - // TODO: let backoff = FutureRetry::new( move || { @@ -504,7 +503,7 @@ where if attempts > n_retries || !should_retry { RetryPolicy::ForwardError(e) } else { - RetryPolicy::WaitRetry(Duration::from_millis(200)) + RetryPolicy::WaitRetry(Duration::from_millis(2u64.pow(attempts) * 50)) } } },