mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 14:43:19 +00:00
p2p: reduce log severity (#5338)
## Description This PR aims to reduce the amount of `Logger.Error(..)` calls. Many of these calls are benign and do not need any intervention. Went from: ``` node1 | E[2020-09-08|14:32:48.407] Connection failed @ recvRoutine (reading byte) module=p2p peer=af8747a81383f40583ae8790d2cc1f92cc7e4a35@192.167.10.4:26656 conn=MConn{192.167.10.4:26656} err="read tcp 192.167.10.3:48614->192.167.10.4:26656: read: connection reset by peer" node1 | E[2020-09-08|14:32:48.407] Stopping peer for error module=p2p peer="Peer{MConn{192.167.10.4:26656} af8747a81383f40583ae8790d2cc1f92cc7e4a35 out}" err="read tcp 192.167.10.3:48614->192.167.10.4:26656: read: connection reset by peer" node1 | E[2020-09-08|14:32:48.407] Error while stopping peer module=p2p peer=af8747a81383f40583ae8790d2cc1f92cc7e4a35@192.167.10.4:26656 err="already stopped" node1 | E[2020-09-08|14:32:48.408] MConnection flush failed module=p2p peer=af8747a81383f40583ae8790d2cc1f92cc7e4a35@192.167.10.4:26656 err="write tcp 192.167.10.3:48614->192.167.10.4:26656: use of closed network connection" ``` To: ``` node1 | E[2020-09-08|14:42:54.023] Stopping peer for error module=p2p peer="Peer{MConn{192.167.10.5:37844} e3d01d1795464a356227d0cba6567d6b94381e55 in}" err=EOF ``` Closes: #4937
This commit is contained in:
@@ -323,7 +323,7 @@ func (c *MConnection) flush() {
|
||||
c.Logger.Debug("Flush", "conn", c)
|
||||
err := c.bufConnWriter.Flush()
|
||||
if err != nil {
|
||||
c.Logger.Error("MConnection flush failed", "err", err)
|
||||
c.Logger.Debug("MConnection flush failed", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ FOR_LOOP:
|
||||
if err == io.EOF {
|
||||
c.Logger.Info("Connection is closed @ recvRoutine (likely by the other side)", "conn", c)
|
||||
} else {
|
||||
c.Logger.Error("Connection failed @ recvRoutine (reading byte)", "conn", c, "err", err)
|
||||
c.Logger.Debug("Connection failed @ recvRoutine (reading byte)", "conn", c, "err", err)
|
||||
}
|
||||
c.stopForError(err)
|
||||
}
|
||||
@@ -626,7 +626,7 @@ FOR_LOOP:
|
||||
channel, ok := c.channelsIdx[byte(pkt.PacketMsg.ChannelID)]
|
||||
if !ok || channel == nil {
|
||||
err := fmt.Errorf("unknown channel %X", pkt.PacketMsg.ChannelID)
|
||||
c.Logger.Error("Connection failed @ recvRoutine", "conn", c, "err", err)
|
||||
c.Logger.Debug("Connection failed @ recvRoutine", "conn", c, "err", err)
|
||||
c.stopForError(err)
|
||||
break FOR_LOOP
|
||||
}
|
||||
@@ -634,7 +634,7 @@ FOR_LOOP:
|
||||
msgBytes, err := channel.recvPacketMsg(*pkt.PacketMsg)
|
||||
if err != nil {
|
||||
if c.IsRunning() {
|
||||
c.Logger.Error("Connection failed @ recvRoutine", "conn", c, "err", err)
|
||||
c.Logger.Debug("Connection failed @ recvRoutine", "conn", c, "err", err)
|
||||
c.stopForError(err)
|
||||
}
|
||||
break FOR_LOOP
|
||||
|
||||
@@ -201,7 +201,7 @@ func (p *peer) OnStop() {
|
||||
p.metricsTicker.Stop()
|
||||
p.BaseService.OnStop()
|
||||
if err := p.mconn.Stop(); err != nil { // stop everything and close the conn
|
||||
p.Logger.Error("Error while stopping peer", "err", err)
|
||||
p.Logger.Debug("Error while stopping peer", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user