@@ -55,15 +55,15 @@ macro_rules! impl_inner_call {
5555 Err ( e) => {
5656 let failed_attempts = errors. len( ) + 1 ;
5757
58+ warn!( "call '{}' failed with {}, retry: {}/{}" , stringify!( $name) , e, failed_attempts, $self. config. retry( ) ) ;
59+
60+ errors. push( e) ;
61+
5862 if retries_exhausted( failed_attempts, $self. config. retry( ) ) {
5963 warn!( "call '{}' failed after {} attempts" , stringify!( $name) , failed_attempts) ;
6064 return Err ( Error :: AllAttemptsErrored ( errors) ) ;
6165 }
6266
63- warn!( "call '{}' failed with {}, retry: {}/{}" , stringify!( $name) , e, failed_attempts, $self. config. retry( ) ) ;
64-
65- errors. push( e) ;
66-
6767 // Only one thread will try to recreate the client getting the write lock,
6868 // other eventual threads will get Err and will block at the beginning of
6969 // previous loop when trying to read()
@@ -79,14 +79,14 @@ macro_rules! impl_inner_call {
7979 Err ( e) => {
8080 let failed_attempts = errors. len( ) + 1 ;
8181
82+ warn!( "re-creating client failed with {}, retry: {}/{}" , e, failed_attempts, $self. config. retry( ) ) ;
83+
84+ errors. push( e) ;
85+
8286 if retries_exhausted( failed_attempts, $self. config. retry( ) ) {
8387 warn!( "re-creating client failed after {} attempts" , failed_attempts) ;
8488 return Err ( Error :: AllAttemptsErrored ( errors) ) ;
8589 }
86-
87- warn!( "re-creating client failed with {}, retry: {}/{}" , e, failed_attempts, $self. config. retry( ) ) ;
88-
89- errors. push( e) ;
9090 }
9191 }
9292 }
0 commit comments