Skip to content

Commit

Permalink
Merge pull request etcd-io#10663 from gyuho/log
Browse files Browse the repository at this point in the history
etcdserver: improve heartbeat send failures logging
  • Loading branch information
xiang90 authored Apr 22, 2019
2 parents 943d688 + 877f11b commit 216808e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion etcdserver/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package etcdserver
import (
"encoding/json"
"expvar"
"fmt"
"log"
"sort"
"sync"
Expand Down Expand Up @@ -357,12 +358,13 @@ func (r *raftNode) processMessages(ms []raftpb.Message) []raftpb.Message {
if r.lg != nil {
r.lg.Warn(
"leader failed to send out heartbeat on time; took too long, leader is overloaded likely from slow disk",
zap.String("to", fmt.Sprintf("%x", ms[i].To)),
zap.Duration("heartbeat-interval", r.heartbeat),
zap.Duration("expected-duration", 2*r.heartbeat),
zap.Duration("exceeded-duration", exceed),
)
} else {
plog.Warningf("failed to send out heartbeat on time (exceeded the %v timeout for %v)", r.heartbeat, exceed)
plog.Warningf("failed to send out heartbeat on time (exceeded the %v timeout for %v, to %x)", r.heartbeat, exceed, ms[i].To)
plog.Warningf("server is likely overloaded")
}
heartbeatSendFailures.Inc()
Expand Down

0 comments on commit 216808e

Please sign in to comment.