1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix for situation where swarm leave causes wait forever for agent to stop

In this case the message to stop the agent is never actually sent
because the swarm node is nil

Signed-off-by: Kyle Wuolle <kyle.wuolle@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Kyle Wuolle 2018-11-26 23:06:23 -08:00 committed by Sebastiaan van Stijn
parent 36d2c8b48e
commit e65c680394
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -298,6 +298,11 @@ func (n *nodeRunner) Stop() error {
n.cancelReconnect = nil
}
if n.swarmNode == nil {
// even though the swarm node is nil we still may need
// to send a node leave event to perform any cleanup required.
if n.cluster != nil {
n.cluster.SendClusterEvent(lncluster.EventNodeLeave)
}
n.mu.Unlock()
return nil
}