@@ -30,17 +30,17 @@ use std::time::Duration;
3030// configuring.
3131const BACKUP_QUEUE_CAPACITY : usize = 100 ;
3232
33- const DEFAULT_INITIAL_RETRY_DELAY_MS : u16 = 50 ;
34- const DEFAULT_MAXIMUM_RETRY_DELAY_SECS : u16 = 5 ;
33+ const DEFAULT_INITIAL_RETRY_DELAY_MS : u16 = 10 ;
34+ const DEFAULT_MAXIMUM_RETRY_DELAY_MS : u16 = 500 ;
3535const DEFAULT_BACKOFF_MULTIPLIER : f32 = 1.5 ;
3636
3737/// Configuration for exponential backoff retry behavior.
3838#[ derive( Debug , Copy , Clone ) ]
3939pub struct RetryConfig {
4040 /// The initial delay before the first retry attempt, in milliseconds.
4141 pub initial_retry_delay_ms : u16 ,
42- /// The maximum delay between retry attempts, in seconds .
43- pub maximum_delay_secs : u16 ,
42+ /// The maximum delay between retry attempts, in milliseconds .
43+ pub maximum_delay_ms : u16 ,
4444 /// The multiplier applied to the delay after each retry attempt.
4545 ///
4646 /// For example, a value of `2.0` doubles the delay after each failed retry.
@@ -51,7 +51,7 @@ impl Default for RetryConfig {
5151 fn default ( ) -> Self {
5252 Self {
5353 initial_retry_delay_ms : DEFAULT_INITIAL_RETRY_DELAY_MS ,
54- maximum_delay_secs : DEFAULT_MAXIMUM_RETRY_DELAY_SECS ,
54+ maximum_delay_ms : DEFAULT_MAXIMUM_RETRY_DELAY_MS ,
5555 backoff_multiplier : DEFAULT_BACKOFF_MULTIPLIER ,
5656 }
5757 }
@@ -593,7 +593,7 @@ impl TierStoreInner {
593593 & self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
594594 ) -> io:: Result < Vec < u8 > > {
595595 let mut delay = Duration :: from_millis ( self . retry_config . initial_retry_delay_ms as u64 ) ;
596- let maximum_delay = Duration :: from_secs ( self . retry_config . maximum_delay_secs as u64 ) ;
596+ let maximum_delay = Duration :: from_millis ( self . retry_config . maximum_delay_ms as u64 ) ;
597597 let mut tries = 0_u16 ;
598598
599599 loop {
@@ -653,7 +653,7 @@ impl TierStoreInner {
653653 & self , primary_namespace : & str , secondary_namespace : & str ,
654654 ) -> io:: Result < Vec < String > > {
655655 let mut delay = Duration :: from_millis ( self . retry_config . initial_retry_delay_ms as u64 ) ;
656- let maximum_delay = Duration :: from_secs ( self . retry_config . maximum_delay_secs as u64 ) ;
656+ let maximum_delay = Duration :: from_millis ( self . retry_config . maximum_delay_ms as u64 ) ;
657657 let mut tries = 0_u16 ;
658658
659659 loop {
@@ -703,7 +703,7 @@ impl TierStoreInner {
703703 & self , primary_namespace : & str , secondary_namespace : & str , key : & str , buf : Vec < u8 > ,
704704 ) -> io:: Result < ( ) > {
705705 let mut delay = Duration :: from_millis ( self . retry_config . initial_retry_delay_ms as u64 ) ;
706- let maximum_delay = Duration :: from_secs ( self . retry_config . maximum_delay_secs as u64 ) ;
706+ let maximum_delay = Duration :: from_millis ( self . retry_config . maximum_delay_ms as u64 ) ;
707707 let mut tries = 0_u16 ;
708708
709709 loop {
@@ -767,7 +767,7 @@ impl TierStoreInner {
767767 & self , primary_namespace : & str , secondary_namespace : & str , key : & str , lazy : bool ,
768768 ) -> io:: Result < ( ) > {
769769 let mut delay = Duration :: from_millis ( self . retry_config . initial_retry_delay_ms as u64 ) ;
770- let maximum_delay = Duration :: from_secs ( self . retry_config . maximum_delay_secs as u64 ) ;
770+ let maximum_delay = Duration :: from_millis ( self . retry_config . maximum_delay_ms as u64 ) ;
771771 let mut tries = 0_u16 ;
772772
773773 loop {
0 commit comments