mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 04:00:05 +00:00
Less Noisy P2P Logs (#5607)
* fix logging issues * change again * fix errors * Merge refs/heads/master into lessNoisy * gaz * Merge branch 'lessNoisy' of https://github.com/prysmaticlabs/geth-sharding into lessNoisy
This commit is contained in:
parent
921263848a
commit
f9eb54661a
@ -18,7 +18,6 @@ go_library(
|
||||
"@com_github_golang_snappy//:go_default_library",
|
||||
"@com_github_pkg_errors//:go_default_library",
|
||||
"@com_github_prysmaticlabs_go_ssz//:go_default_library",
|
||||
"@com_github_sirupsen_logrus//:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -10,7 +10,6 @@ import (
|
||||
errors "github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/go-ssz"
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var _ = NetworkEncoding(&SszNetworkEncoder{})
|
||||
@ -192,10 +191,9 @@ func (e SszNetworkEncoder) MaxLength(length int) int {
|
||||
// Writes a bytes value through a snappy buffered writer.
|
||||
func writeSnappyBuffer(w io.Writer, b []byte) (int, error) {
|
||||
bufWriter := snappy.NewBufferedWriter(w)
|
||||
defer func() {
|
||||
if err := bufWriter.Close(); err != nil {
|
||||
logrus.WithError(err).Error("Failed to close snappy buffered writer")
|
||||
num, err := bufWriter.Write(b)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
}()
|
||||
return bufWriter.Write(b)
|
||||
return num, bufWriter.Close()
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ func (s *Service) AddConnectionHandler(reqFunc func(ctx context.Context, id peer
|
||||
go func() {
|
||||
log.WithField("reason", "at peer limit").Trace("Ignoring connection request")
|
||||
if err := goodbyeFunc(context.Background(), conn.RemotePeer()); err != nil {
|
||||
log.WithError(err).Error("Unable to send goodbye message to peer")
|
||||
log.WithError(err).Trace("Unable to send goodbye message to peer")
|
||||
}
|
||||
if err := s.Disconnect(conn.RemotePeer()); err != nil {
|
||||
log.WithError(err).Error("Unable to disconnect from peer")
|
||||
|
@ -110,6 +110,12 @@ func (r *Service) registerRPC(topic string, base interface{}, handle rpcHandler)
|
||||
if t.Kind() == reflect.Ptr {
|
||||
msg := reflect.New(t.Elem())
|
||||
if err := r.p2p.Encoding().DecodeWithLength(stream, msg.Interface()); err != nil {
|
||||
// Debug logs for goodbye/status errors
|
||||
if strings.Contains(topic, p2p.RPCGoodByeTopic) || strings.Contains(topic, p2p.RPCStatusTopic) {
|
||||
log.WithError(err).Debug("Failed to decode goodbye stream message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return
|
||||
}
|
||||
log.WithError(err).Warn("Failed to decode stream message")
|
||||
traceutil.AnnotateError(span, err)
|
||||
return
|
||||
|
@ -34,7 +34,7 @@ func (r *Service) maintainPeerStatuses() {
|
||||
}
|
||||
if roughtime.Now().After(lastUpdated.Add(interval)) {
|
||||
if err := r.reValidatePeer(r.ctx, id); err != nil {
|
||||
log.WithField("peer", id).WithError(err).Error("Failed to reValidate peer")
|
||||
log.WithField("peer", id).WithError(err).Error("Failed to revalidate peer")
|
||||
}
|
||||
}
|
||||
}(pid)
|
||||
|
Loading…
Reference in New Issue
Block a user