Skip to content

Commit

Permalink
Merge pull request #4895 from petermattis/pmattis/gossip-bootstrap
Browse files Browse the repository at this point in the history
gossip: retry bootstrapping if we can't start a client
  • Loading branch information
petermattis committed Mar 6, 2016
2 parents cb2710c + 689734f commit e6793e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gossip/gossip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
})
Expand All @@ -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
}
Expand Down

0 comments on commit e6793e1

Please sign in to comment.