@@ -31,17 +31,17 @@ use std::time::Duration;
3131// configuring.
3232const BACKUP_QUEUE_CAPACITY : usize = 100 ;
3333
34- const DEFAULT_INITIAL_RETRY_DELAY_MS : u16 = 50 ;
35- const DEFAULT_MAXIMUM_RETRY_DELAY_SECS : u16 = 5 ;
34+ const DEFAULT_INITIAL_RETRY_DELAY_MS : u16 = 10 ;
35+ const DEFAULT_MAXIMUM_RETRY_DELAY_MS : u16 = 500 ;
3636const DEFAULT_BACKOFF_MULTIPLIER : f32 = 1.5 ;
3737
3838/// Configuration for exponential backoff retry behavior.
3939#[ derive( Debug , Copy , Clone ) ]
4040pub struct RetryConfig {
4141 /// The initial delay before the first retry attempt, in milliseconds.
4242 pub initial_retry_delay_ms : u16 ,
43- /// The maximum delay between retry attempts, in seconds .
44- pub maximum_delay_secs : u16 ,
43+ /// The maximum delay between retry attempts, in milliseconds .
44+ pub maximum_delay_ms : u16 ,
4545 /// The multiplier applied to the delay after each retry attempt.
4646 ///
4747 /// For example, a value of `2.0` doubles the delay after each failed retry.
@@ -52,7 +52,7 @@ impl Default for RetryConfig {
5252 fn default ( ) -> Self {
5353 Self {
5454 initial_retry_delay_ms : DEFAULT_INITIAL_RETRY_DELAY_MS ,
55- maximum_delay_secs : DEFAULT_MAXIMUM_RETRY_DELAY_SECS ,
55+ maximum_delay_ms : DEFAULT_MAXIMUM_RETRY_DELAY_MS ,
5656 backoff_multiplier : DEFAULT_BACKOFF_MULTIPLIER ,
5757 }
5858 }
@@ -515,7 +515,7 @@ impl TierStoreInner {
515515 & self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
516516 ) -> io:: Result < Vec < u8 > > {
517517 let mut delay = Duration :: from_millis ( self . retry_config . initial_retry_delay_ms as u64 ) ;
518- let maximum_delay = Duration :: from_secs ( self . retry_config . maximum_delay_secs as u64 ) ;
518+ let maximum_delay = Duration :: from_millis ( self . retry_config . maximum_delay_ms as u64 ) ;
519519 let mut tries = 0_u16 ;
520520
521521 loop {
@@ -575,7 +575,7 @@ impl TierStoreInner {
575575 & self , primary_namespace : & str , secondary_namespace : & str ,
576576 ) -> io:: Result < Vec < String > > {
577577 let mut delay = Duration :: from_millis ( self . retry_config . initial_retry_delay_ms as u64 ) ;
578- let maximum_delay = Duration :: from_secs ( self . retry_config . maximum_delay_secs as u64 ) ;
578+ let maximum_delay = Duration :: from_millis ( self . retry_config . maximum_delay_ms as u64 ) ;
579579 let mut tries = 0_u16 ;
580580
581581 loop {
@@ -625,7 +625,7 @@ impl TierStoreInner {
625625 & self , primary_namespace : & str , secondary_namespace : & str , key : & str , buf : Vec < u8 > ,
626626 ) -> io:: Result < ( ) > {
627627 let mut delay = Duration :: from_millis ( self . retry_config . initial_retry_delay_ms as u64 ) ;
628- let maximum_delay = Duration :: from_secs ( self . retry_config . maximum_delay_secs as u64 ) ;
628+ let maximum_delay = Duration :: from_millis ( self . retry_config . maximum_delay_ms as u64 ) ;
629629 let mut tries = 0_u16 ;
630630
631631 loop {
@@ -689,7 +689,7 @@ impl TierStoreInner {
689689 & self , primary_namespace : & str , secondary_namespace : & str , key : & str , lazy : bool ,
690690 ) -> io:: Result < ( ) > {
691691 let mut delay = Duration :: from_millis ( self . retry_config . initial_retry_delay_ms as u64 ) ;
692- let maximum_delay = Duration :: from_secs ( self . retry_config . maximum_delay_secs as u64 ) ;
692+ let maximum_delay = Duration :: from_millis ( self . retry_config . maximum_delay_ms as u64 ) ;
693693 let mut tries = 0_u16 ;
694694
695695 loop {
0 commit comments