Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ macro_rules! impl_inner_call {
Err(e) => {
let failed_attempts = errors.len() + 1;

warn!("call '{}' failed with {}, retry: {}/{}", stringify!($name), e, failed_attempts, $self.config.retry());

errors.push(e);

if retries_exhausted(failed_attempts, $self.config.retry()) {
warn!("call '{}' failed after {} attempts", stringify!($name), failed_attempts);
return Err(Error::AllAttemptsErrored(errors));
}

warn!("call '{}' failed with {}, retry: {}/{}", stringify!($name), e, failed_attempts, $self.config.retry());

errors.push(e);

// Only one thread will try to recreate the client getting the write lock,
// other eventual threads will get Err and will block at the beginning of
// previous loop when trying to read()
Expand All @@ -79,14 +79,14 @@ macro_rules! impl_inner_call {
Err(e) => {
let failed_attempts = errors.len() + 1;

warn!("re-creating client failed with {}, retry: {}/{}", e, failed_attempts, $self.config.retry());

errors.push(e);

if retries_exhausted(failed_attempts, $self.config.retry()) {
warn!("re-creating client failed after {} attempts", failed_attempts);
return Err(Error::AllAttemptsErrored(errors));
}

warn!("re-creating client failed with {}, retry: {}/{}", e, failed_attempts, $self.config.retry());

errors.push(e);
}
}
}
Expand Down