Skip to content

Commit

Permalink
refactor: reduce log level from error to warn for RPC failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Aug 2, 2021
1 parent 7e18c2c commit 8e0cca5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions async-raft/src/replication/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ impl<D: AppData, R: AppDataResponse, N: RaftNetwork<D>, S: RaftStorage<D, R>> Re
Ok(outer_res) => match outer_res {
Ok(res) => res,
Err(err) => {
tracing::error!(error=%err, "error sending AppendEntries RPC to target");
tracing::warn!(error=%err, "error sending AppendEntries RPC to target");
return;
}
},
Err(err) => {
tracing::error!(error=%err, "timeout while sending AppendEntries RPC to target");
tracing::warn!(error=%err, "timeout while sending AppendEntries RPC to target");
return;
}
};
Expand Down Expand Up @@ -789,7 +789,7 @@ impl<'a, D: AppData, R: AppDataResponse, N: RaftNetwork<D>, S: RaftStorage<D, R>
// If we have a snapshot to work with, then stream it.
if let Some(snapshot) = self.snapshot.take() {
if let Err(err) = self.stream_snapshot(snapshot).await {
tracing::error!(error=%err, "error streaming snapshot to target");
tracing::warn!(error=%err, "error streaming snapshot to target");
}
continue;
}
Expand Down Expand Up @@ -865,12 +865,12 @@ impl<'a, D: AppData, R: AppDataResponse, N: RaftNetwork<D>, S: RaftStorage<D, R>
Ok(outer_res) => match outer_res {
Ok(res) => res,
Err(err) => {
tracing::error!(error=%err, "error sending InstallSnapshot RPC to target");
tracing::warn!(error=%err, "error sending InstallSnapshot RPC to target");
continue;
}
},
Err(err) => {
tracing::error!(error=%err, "timeout while sending InstallSnapshot RPC to target");
tracing::warn!(error=%err, "timeout while sending InstallSnapshot RPC to target");
continue;
}
};
Expand Down

0 comments on commit 8e0cca5

Please sign in to comment.