mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-05 06:13:10 +00:00
reduce log verbosity; debug mostly
This commit is contained in:
parent
f125ed69b3
commit
06a12f17b7
6
comm.go
6
comm.go
@ -49,7 +49,7 @@ func (p *PubSub) handleNewStream(s network.Stream) {
|
||||
if err != nil {
|
||||
if err != io.EOF {
|
||||
s.Reset()
|
||||
log.Infof("error reading rpc from %s: %s", s.Conn().RemotePeer(), err)
|
||||
log.Debugf("error reading rpc from %s: %s", s.Conn().RemotePeer(), err)
|
||||
} else {
|
||||
// Just be nice. They probably won't read this
|
||||
// but it doesn't hurt to send it.
|
||||
@ -108,7 +108,7 @@ func (p *PubSub) handlePeerEOF(ctx context.Context, s network.Stream) {
|
||||
}
|
||||
return
|
||||
}
|
||||
log.Warn("unexpected message from ", s.Conn().RemotePeer())
|
||||
log.Debugf("unexpected message from %s", s.Conn().RemotePeer())
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ func (p *PubSub) handleSendingMessages(ctx context.Context, s network.Stream, ou
|
||||
err := writeMsg(&rpc.RPC)
|
||||
if err != nil {
|
||||
s.Reset()
|
||||
log.Infof("writing message to %s: %s", s.Conn().RemotePeer(), err)
|
||||
log.Debugf("writing message to %s: %s", s.Conn().RemotePeer(), err)
|
||||
return
|
||||
}
|
||||
case <-ctx.Done():
|
||||
|
||||
@ -1059,7 +1059,7 @@ func (gs *GossipSubRouter) sendRPC(p peer.ID, out *RPC) {
|
||||
}
|
||||
|
||||
func (gs *GossipSubRouter) doDropRPC(rpc *RPC, p peer.ID, reason string) {
|
||||
log.Warnf("dropping message to peer %s: %s", p.Pretty(), reason)
|
||||
log.Debugf("dropping message to peer %s: %s", p.Pretty(), reason)
|
||||
gs.tracer.DropRPC(rpc, p)
|
||||
// push control messages that need to be retried
|
||||
ctl := rpc.GetControl()
|
||||
|
||||
@ -924,13 +924,13 @@ func (p *PubSub) handleIncomingRPC(rpc *RPC) {
|
||||
|
||||
// ask the router to vet the peer before commiting any processing resources
|
||||
if !p.rt.AcceptFrom(rpc.from) {
|
||||
log.Infof("received message from router graylisted peer %s. Dropping RPC", rpc.from)
|
||||
log.Debugf("received message from router graylisted peer %s. Dropping RPC", rpc.from)
|
||||
return
|
||||
}
|
||||
|
||||
for _, pmsg := range rpc.GetPublish() {
|
||||
if !(p.subscribedToMsg(pmsg) || p.canRelayMsg(pmsg)) {
|
||||
log.Warn("received message we didn't subscribe to. Dropping.")
|
||||
log.Debug("received message we didn't subscribe to. Dropping.")
|
||||
continue
|
||||
}
|
||||
|
||||
@ -951,14 +951,14 @@ func (p *PubSub) pushMsg(msg *Message) {
|
||||
src := msg.ReceivedFrom
|
||||
// reject messages from blacklisted peers
|
||||
if p.blacklist.Contains(src) {
|
||||
log.Warnf("dropping message from blacklisted peer %s", src)
|
||||
log.Debugf("dropping message from blacklisted peer %s", src)
|
||||
p.tracer.RejectMessage(msg, rejectBlacklstedPeer)
|
||||
return
|
||||
}
|
||||
|
||||
// even if they are forwarded by good peers
|
||||
if p.blacklist.Contains(msg.GetFrom()) {
|
||||
log.Warnf("dropping message from blacklisted source %s", src)
|
||||
log.Debugf("dropping message from blacklisted source %s", src)
|
||||
p.tracer.RejectMessage(msg, rejectBlacklistedSource)
|
||||
return
|
||||
}
|
||||
|
||||
4
score.go
4
score.go
@ -632,7 +632,7 @@ func (ps *peerScore) DeliverMessage(msg *Message) {
|
||||
|
||||
// defensive check that this is the first delivery trace -- delivery status should be unknown
|
||||
if drec.status != deliveryUnknown {
|
||||
log.Warnf("unexpected delivery trace: message from %s was first seen %s ago and has delivery status %d", msg.ReceivedFrom, time.Now().Sub(drec.firstSeen), drec.status)
|
||||
log.Debugf("unexpected delivery trace: message from %s was first seen %s ago and has delivery status %d", msg.ReceivedFrom, time.Now().Sub(drec.firstSeen), drec.status)
|
||||
return
|
||||
}
|
||||
|
||||
@ -683,7 +683,7 @@ func (ps *peerScore) RejectMessage(msg *Message, reason string) {
|
||||
|
||||
// defensive check that this is the first rejection trace -- delivery status should be unknown
|
||||
if drec.status != deliveryUnknown {
|
||||
log.Warnf("unexpected rejection trace: message from %s was first seen %s ago and has delivery status %d", msg.ReceivedFrom, time.Now().Sub(drec.firstSeen), drec.status)
|
||||
log.Debugf("unexpected rejection trace: message from %s was first seen %s ago and has delivery status %d", msg.ReceivedFrom, time.Now().Sub(drec.firstSeen), drec.status)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ type tagTracer struct {
|
||||
func newTagTracer(cmgr connmgr.ConnManager) *tagTracer {
|
||||
decayer, ok := connmgr.SupportsDecay(cmgr)
|
||||
if !ok {
|
||||
log.Warnf("connection manager does not support decaying tags, delivery tags will not be applied")
|
||||
log.Debugf("connection manager does not support decaying tags, delivery tags will not be applied")
|
||||
}
|
||||
return &tagTracer{
|
||||
cmgr: cmgr,
|
||||
|
||||
@ -204,7 +204,7 @@ func (t *RemoteTracer) doWrite() {
|
||||
|
||||
s, err := t.openStream()
|
||||
if err != nil {
|
||||
log.Warnf("error opening remote tracer stream: %s", err.Error())
|
||||
log.Debugf("error opening remote tracer stream: %s", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
@ -239,13 +239,13 @@ func (t *RemoteTracer) doWrite() {
|
||||
|
||||
err = w.WriteMsg(&batch)
|
||||
if err != nil {
|
||||
log.Warnf("error writing trace event batch: %s", err)
|
||||
log.Debugf("error writing trace event batch: %s", err)
|
||||
goto end
|
||||
}
|
||||
|
||||
err = gzipW.Flush()
|
||||
if err != nil {
|
||||
log.Warnf("error flushin gzip stream: %s", err)
|
||||
log.Debugf("error flushin gzip stream: %s", err)
|
||||
goto end
|
||||
}
|
||||
|
||||
@ -269,7 +269,7 @@ func (t *RemoteTracer) doWrite() {
|
||||
s.Reset()
|
||||
s, err = t.openStream()
|
||||
if err != nil {
|
||||
log.Warnf("error opening remote tracer stream: %s", err.Error())
|
||||
log.Debugf("error opening remote tracer stream: %s", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -200,7 +200,7 @@ func (v *validation) Push(src peer.ID, msg *Message) bool {
|
||||
select {
|
||||
case v.validateQ <- &validateReq{vals, src, msg}:
|
||||
default:
|
||||
log.Warnf("message validation throttled: queue full; dropping message from %s", src)
|
||||
log.Debugf("message validation throttled: queue full; dropping message from %s", src)
|
||||
v.tracer.RejectMessage(msg, rejectValidationQueueFull)
|
||||
}
|
||||
return false
|
||||
@ -245,7 +245,7 @@ func (v *validation) validate(vals []*topicVal, src peer.ID, msg *Message) {
|
||||
// the Signature is required to be nil upon receiving the message in PubSub.pushMsg.
|
||||
if msg.Signature != nil {
|
||||
if !v.validateSignature(msg) {
|
||||
log.Warnf("message signature validation failed; dropping message from %s", src)
|
||||
log.Debugf("message signature validation failed; dropping message from %s", src)
|
||||
v.tracer.RejectMessage(msg, rejectInvalidSignature)
|
||||
return
|
||||
}
|
||||
@ -285,7 +285,7 @@ loop:
|
||||
}
|
||||
|
||||
if result == ValidationReject {
|
||||
log.Warnf("message validation failed; dropping message from %s", src)
|
||||
log.Debugf("message validation failed; dropping message from %s", src)
|
||||
v.tracer.RejectMessage(msg, rejectValidationFailed)
|
||||
return
|
||||
}
|
||||
@ -299,7 +299,7 @@ loop:
|
||||
<-v.validateThrottle
|
||||
}()
|
||||
default:
|
||||
log.Warnf("message validation throttled; dropping message from %s", src)
|
||||
log.Debugf("message validation throttled; dropping message from %s", src)
|
||||
v.tracer.RejectMessage(msg, rejectValidationThrottled)
|
||||
}
|
||||
return
|
||||
@ -343,7 +343,7 @@ func (v *validation) doValidateTopic(vals []*topicVal, src peer.ID, msg *Message
|
||||
v.tracer.RejectMessage(msg, rejectValidationIgnored)
|
||||
return
|
||||
case validationThrottled:
|
||||
log.Warnf("message validation throttled; ignoring message from %s", src)
|
||||
log.Debugf("message validation throttled; ignoring message from %s", src)
|
||||
v.tracer.RejectMessage(msg, rejectValidationThrottled)
|
||||
|
||||
default:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user