mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Don’t attempt to reconnect swarm on failed join after timeout
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
94cd7ed72d
commit
7381c84bfb
1 changed files with 9 additions and 2 deletions
|
@ -481,8 +481,15 @@ func (c *Cluster) Join(req types.JoinRequest) error {
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-time.After(swarmConnectTimeout):
|
case <-time.After(swarmConnectTimeout):
|
||||||
// attempt to connect will continue in background, also reconnecting
|
// attempt to connect will continue in background, but reconnect only if it didn't fail
|
||||||
go c.reconnectOnFailure(n)
|
go func() {
|
||||||
|
select {
|
||||||
|
case <-n.Ready():
|
||||||
|
c.reconnectOnFailure(n)
|
||||||
|
case <-n.done:
|
||||||
|
logrus.Errorf("failed to join the cluster: %+v", c.err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
return ErrSwarmJoinTimeoutReached
|
return ErrSwarmJoinTimeoutReached
|
||||||
case <-n.Ready():
|
case <-n.Ready():
|
||||||
go c.reconnectOnFailure(n)
|
go c.reconnectOnFailure(n)
|
||||||
|
|
Loading…
Add table
Reference in a new issue