Merge pull request #1702 from wpaulino/peer-bootstrapper-backoff

server: prevent increasing epochErrors if conn was established
This commit is contained in:
Olaoluwa Osuntokun 2018-08-08 19:54:54 -07:00 committed by GitHub
commit 8a56b33aa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1346,6 +1346,10 @@ func (s *server) peerBootstrapper(numTargetPeers uint32,
s.connectToPeer(a, errChan)
select {
case err := <-errChan:
if err == nil {
return
}
srvrLog.Errorf("Unable to "+
"connect to %v: %v",
a, err)
@ -1413,6 +1417,9 @@ func (s *server) initialPeerBootstrap(ignore map[autopilot.NodeID]struct{},
// us down.
select {
case err := <-errChan:
if err == nil {
return
}
srvrLog.Errorf("Unable to connect to "+
"%v: %v", addr, err)
// TODO: tune timeout? 3 seconds might be *too*