Browse Source

only log "Reached max attempts to dial" once (#3144)

Closes #3037
pull/3206/head
Anton Kaliaev 6 years ago
committed by GitHub
parent
commit
c4157549ab
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +5
    -1
      p2p/pex/pex_reactor.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -19,6 +19,7 @@ Special thanks to external contributors on this release:
### FEATURES:
### IMPROVEMENTS:
- [pex] \#3037 only log "Reached max attempts to dial" once
### BUG FIXES:
- [p2p] \#2967 Fix file descriptor leaks

+ 5
- 1
p2p/pex/pex_reactor.go View File

@ -471,7 +471,11 @@ func (r *PEXReactor) dialPeer(addr *p2p.NetAddress) {
attempts, lastDialed := r.dialAttemptsInfo(addr)
if attempts > maxAttemptsToDial {
r.Logger.Error("Reached max attempts to dial", "addr", addr, "attempts", attempts)
// Do not log the message if the addr gets readded.
if attempts+1 == maxAttemptsToDial {
r.Logger.Info("Reached max attempts to dial", "addr", addr, "attempts", attempts)
r.attemptsToDial.Store(addr.DialString(), _attemptsToDial{attempts + 1, time.Now()})
}
r.book.MarkBad(addr)
return
}


Loading…
Cancel
Save