Browse Source

p2p: avoid retry delay in error case (#6591)

pull/6595/head
Sam Kleinman 4 years ago
committed by GitHub
parent
commit
d228afc548
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      internal/p2p/peermanager.go

+ 1
- 1
internal/p2p/peermanager.go View File

@ -539,7 +539,7 @@ func (m *PeerManager) DialFailed(address NodeAddress) error {
// timeout has elapsed, so that we can consider dialing it again. We
// calculate the retry delay outside the goroutine, since it must hold
// the mutex lock.
if d := m.retryDelay(addressInfo.DialFailures, peer.Persistent); d != retryNever {
if d := m.retryDelay(addressInfo.DialFailures, peer.Persistent); d != 0 && d != retryNever {
go func() {
// Use an explicit timer with deferred cleanup instead of
// time.After(), to avoid leaking goroutines on PeerManager.Close().


Loading…
Cancel
Save