Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

p2p, retrieval, storage: reduce logging #2140

Merged
merged 1 commit into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
p2p, retrieval, storage: you log me long time
  • Loading branch information
acud committed Mar 16, 2020
commit f64bc0c85571585a1a719f172788b4f266052ad1
6 changes: 3 additions & 3 deletions network/retrieval/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,11 @@ FINDPEER:

protoPeer := r.getPeer(sp.ID())
if protoPeer == nil {
r.logger.Warn("findPeer returned a peer to skip", "peer", sp.String(), "retry", retries, "ref", req.Addr)
r.logger.Trace("findPeer returned a peer to skip", "peer", sp.String(), "retry", retries, "ref", req.Addr)
req.PeersToSkip.Store(sp.ID().String(), time.Now())
retries++
if retries == maxFindPeerRetries {
r.logger.Error("max find peer retries reached", "max retries", maxFindPeerRetries, "ref", req.Addr)
r.logger.Trace("max find peer retries reached", "max retries", maxFindPeerRetries, "ref", req.Addr)
return nil, func() {}, ErrNoPeerFound
}

Expand All @@ -423,7 +423,7 @@ FINDPEER:
}
err = protoPeer.Send(ctx, ret)
if err != nil {
protoPeer.logger.Error("error sending retrieve request to peer", "ruid", ret.Ruid, "err", err)
protoPeer.logger.Trace("error sending retrieve request to peer", "ruid", ret.Ruid, "err", err)
cleanup()
return nil, func() {}, err
}
Expand Down
2 changes: 1 addition & 1 deletion p2p/protocols/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (p *Peer) run(handler func(ctx context.Context, msg interface{}) error) err
if errors.As(err, &e) {
p.Drop(err.Error())
} else {
log.Warn(err.Error())
log.Trace(err.Error())
}
}
}()
Expand Down
2 changes: 1 addition & 1 deletion storage/netstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func (n *NetStore) RemoteFetch(ctx context.Context, req *Request, fi *Fetcher) (
osp.Finish()
break
case <-ctx.Done(): // global fetcher timeout
n.logger.Warn("remote.fetch, global timeout fail", "ref", ref, "err", ctx.Err())
n.logger.Trace("remote.fetch, global timeout fail", "ref", ref, "err", ctx.Err())
metrics.GetOrRegisterCounter("remote.fetch.timeout.global", nil).Inc(1)

osp.LogFields(olog.Bool("fail", true))
Expand Down