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

Merge pull request #38906 from thaJeztah/carry_38304_fix_swarm_leave_hanging

Fix for situation where swarm leave causes wait forever for agent to stop
This commit is contained in:
Tibor Vass 2019-03-21 14:12:41 -07:00 committed by GitHub
commit 06c9ae1327
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
}