Skip to content

Commit

Permalink
reduce log verbosity; debug mostly
Browse files Browse the repository at this point in the history
vyzo committed Sep 1, 2020
1 parent f125ed6 commit 06a12f1
Showing 7 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions comm.go
Original file line number Diff line number Diff line change
@@ -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():
2 changes: 1 addition & 1 deletion gossipsub.go
Original file line number Diff line number Diff line change
@@ -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()
8 changes: 4 additions & 4 deletions pubsub.go
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 2 deletions score.go
Original file line number Diff line number Diff line change
@@ -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
}

2 changes: 1 addition & 1 deletion tag_tracer.go
Original file line number Diff line number Diff line change
@@ -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,
8 changes: 4 additions & 4 deletions tracer.go
Original file line number Diff line number Diff line change
@@ -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
}

10 changes: 5 additions & 5 deletions validation.go
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit 06a12f1

Please sign in to comment.