mirror of
https://github.com/docker/cli.git
synced 2026-01-25 03:42:05 +03:00
Don’t attempt to reconnect swarm on failed join after timeout
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Upstream-commit: 7381c84bfb9d586a5a7b87a9d6bcaf3ee15a4256 Component: engine
This commit is contained in:
@@ -481,8 +481,15 @@ func (c *Cluster) Join(req types.JoinRequest) error {
|
||||
|
||||
select {
|
||||
case <-time.After(swarmConnectTimeout):
|
||||
// attempt to connect will continue in background, also reconnecting
|
||||
go c.reconnectOnFailure(n)
|
||||
// attempt to connect will continue in background, but reconnect only if it didn't fail
|
||||
go func() {
|
||||
select {
|
||||
case <-n.Ready():
|
||||
c.reconnectOnFailure(n)
|
||||
case <-n.done:
|
||||
logrus.Errorf("failed to join the cluster: %+v", c.err)
|
||||
}
|
||||
}()
|
||||
return ErrSwarmJoinTimeoutReached
|
||||
case <-n.Ready():
|
||||
go c.reconnectOnFailure(n)
|
||||
|
||||
Reference in New Issue
Block a user