Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
fix: reduce log verbosity
Browse files Browse the repository at this point in the history
These log messages are frequent and were causing lock contention at scale.
  • Loading branch information
Stebalien authored and guseggert committed Aug 31, 2021
1 parent 2b51297 commit 6dce2a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/decision/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,15 +680,17 @@ func (e *Engine) ReceiveFrom(from peer.ID, blks []blocks.Block) {
for _, p := range e.peerLedger.Peers(k) {
ledger, ok := e.ledgerMap[p]
if !ok {
log.Errorw("failed to find peer in ledger", "peer", p)
// This can happen if the peer has disconnected while we're processing this list.
log.Debugw("failed to find peer in ledger", "peer", p)
missingWants[p] = append(missingWants[p], k)
continue
}
ledger.lk.RLock()
entry, ok := ledger.WantListContains(k)
ledger.lk.RUnlock()
if !ok { // should never happen
log.Errorw("wantlist index doesn't match peer's wantlist", "peer", p)
if !ok {
// This can happen if the peer has canceled their want while we're processing this message.
log.Debugw("wantlist index doesn't match peer's wantlist", "peer", p)
missingWants[p] = append(missingWants[p], k)
continue
}
Expand Down

0 comments on commit 6dce2a1

Please sign in to comment.