From 689734ffd89388acecf2f8b351a889e3d089d7e4 Mon Sep 17 00:00:00 2001 From: Peter Mattis Date: Sat, 5 Mar 2016 20:44:17 -0500 Subject: [PATCH] gossip: retry bootstrapping if we can't start a client Fixes #4714. Fixes #4822. Fixes #4835. Fixes #4892. Fixes #4893. Fixes #4894. --- gossip/gossip.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gossip/gossip.go b/gossip/gossip.go index e8f8942f1f51..39a14967f820 100644 --- a/gossip/gossip.go +++ b/gossip/gossip.go @@ -768,6 +768,10 @@ func (g *Gossip) bootstrap() { // Try to get another bootstrap address from the resolvers. if addr := g.getNextBootstrapAddress(); addr != nil { g.startClient(addr, stopper) + } else { + // We couldn't start a client, signal that we're stalled so that + // we'll retry. + g.maybeSignalStalledLocked() } } }) @@ -777,14 +781,14 @@ func (g *Gossip) bootstrap() { select { case <-bootstrapTimer.C: bootstrapTimer.Read = true - // continue + // break case <-stopper.ShouldStop(): return } // Block until we need bootstrapping again. select { case <-g.stalled: - // continue + // break case <-stopper.ShouldStop(): return }