e2a7ae61b2
The agent sometimes calls into libnetwork code that in turn calls (*Cluster).IsAgent and (*Cluster).IsManager. These can cause the node shutdown process to time out, since they wait for a lock that is held by Cleanup. It turns out c.mu doesn't need to be held while calling Stop. Holding controlMutex is sufficient. Also, (*nodeRunner).Stop must release nodeRunner's mu during the node shutdown process, otherwise the same call into Cluster would be blocked on this lock instead. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com> Upstream-commit: 44ce809c954eec6755ba975ab7fe1c11ebbdfed2 Component: engine