Skip to content

Commit

Permalink
change s.failures to failures for heartbeat backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
HridoyRoy committed Mar 17, 2022
1 parent 2411b31 commit 585ec5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func (r *Raft) heartbeat(s *followerReplication, stopCh chan struct{}) {

start := time.Now()
if err := r.trans.AppendEntries(peer.ID, peer.Address, &req, &resp); err != nil {
nextBackoffTime := cappedExponentialBackoff(failureWait, s.failures, maxFailureScale, r.config().HeartbeatTimeout/2)
nextBackoffTime := cappedExponentialBackoff(failureWait, failures, maxFailureScale, r.config().HeartbeatTimeout/2)
r.logger.Error("failed to heartbeat to", "peer", peer.Address, "backoff time",
nextBackoffTime, "error", err)
r.observe(FailedHeartbeatObservation{PeerID: peer.ID, LastContact: s.LastContact()})
Expand Down

0 comments on commit 585ec5b

Please sign in to comment.