mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: remove code duplication from the peer.send func
During the refactoring process, duplicate logging of the send buffer overflow event was added. Each of these log lines logs exactly the same information, the logging context is sufficient to distinguish the cause. Additionally, the unnecessary context (in parentheses) in the log message was removed, which was necessary without the zap context (with the old logger), but now only confuses.
This commit is contained in:
parent
a1fd98c6b0
commit
daf7e0350a
@ -250,10 +250,9 @@ func (p *peer) send(m raftpb.Message) {
|
||||
if isMsgSnap(m) {
|
||||
p.r.ReportSnapshot(m.To, raft.SnapshotFailure)
|
||||
}
|
||||
if p.status.isActive() {
|
||||
if p.lg != nil {
|
||||
p.lg.Warn(
|
||||
"dropped internal Raft message since sending buffer is full (overloaded network)",
|
||||
"dropped internal Raft message since sending buffer is full",
|
||||
zap.String("message-type", m.Type.String()),
|
||||
zap.String("local-member-id", p.localID.String()),
|
||||
zap.String("from", types.ID(m.From).String()),
|
||||
@ -262,19 +261,6 @@ func (p *peer) send(m raftpb.Message) {
|
||||
zap.Bool("remote-peer-active", p.status.isActive()),
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if p.lg != nil {
|
||||
p.lg.Warn(
|
||||
"dropped internal Raft message since sending buffer is full (overloaded network)",
|
||||
zap.String("message-type", m.Type.String()),
|
||||
zap.String("local-member-id", p.localID.String()),
|
||||
zap.String("from", types.ID(m.From).String()),
|
||||
zap.String("remote-peer-id", p.id.String()),
|
||||
zap.String("remote-peer-name", name),
|
||||
zap.Bool("remote-peer-active", p.status.isActive()),
|
||||
)
|
||||
}
|
||||
}
|
||||
sentFailures.WithLabelValues(types.ID(m.To).String()).Inc()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user