diff --git a/src/daft-io/src/retry.rs b/src/daft-io/src/retry.rs index 5762a070b0f..c4a87aa8606 100644 --- a/src/daft-io/src/retry.rs +++ b/src/daft-io/src/retry.rs @@ -60,7 +60,12 @@ impl ExponentialBackoff { } let jitter = rand::rng() - .random_range(0..((1 << attempts) * self.jitter_ms)) + .random_range( + 0..(1u64 + .checked_shl(attempts as u32) + .unwrap_or(u64::MAX) + .saturating_mul(self.jitter_ms)), + ) .min(self.max_backoff_ms); tokio::time::sleep(Duration::from_millis(jitter)).await;