Skip to content

Commit

Permalink
Fixed S3 backoff bug
Browse files Browse the repository at this point in the history
mdecimus committed Jan 16, 2025
1 parent bfba299 commit 4901411
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions crates/common/src/config/smtp/queue.rs
Original file line number Diff line number Diff line change
@@ -390,10 +390,12 @@ fn parse_queue_throttle(config: &mut Config) -> QueueThrottle {
host: Vec::new(),
outbound_concurrency: config
.property_or_default::<usize>("queue.threads.remote", "25")
.unwrap_or(25),
.unwrap_or(25)
.max(1),
local_concurrency: config
.property_or_default::<usize>("queue.threads.local", "10")
.unwrap_or(10),
.unwrap_or(10)
.max(1),
};

let all_throttles = parse_throttle(
6 changes: 3 additions & 3 deletions crates/store/src/backend/s3/mod.rs
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ impl S3Store {
500..=599 if retries_left > 0 => {
// wait backoff
tokio::time::sleep(Duration::from_secs(
1 << (self.max_retries - retries_left).max(6),
1 << (self.max_retries - retries_left).min(6),
))
.await;

@@ -130,7 +130,7 @@ impl S3Store {
500..=599 if retries_left > 0 => {
// wait backoff
tokio::time::sleep(Duration::from_secs(
1 << (self.max_retries - retries_left).max(6),
1 << (self.max_retries - retries_left).min(6),
))
.await;

@@ -161,7 +161,7 @@ impl S3Store {
500..=599 if retries_left > 0 => {
// wait backoff
tokio::time::sleep(Duration::from_secs(
1 << (self.max_retries - retries_left).max(6),
1 << (self.max_retries - retries_left).min(6),
))
.await;

0 comments on commit 4901411

Please sign in to comment.