Add workaround for possible SetClusterProvider deadlock

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2017-01-10 15:11:49 -08:00
parent 340f288211
commit 4b2b0eb608

View file

@ -449,7 +449,9 @@ func (daemon *Daemon) registerLink(parent, child *container.Container, alias str
// SetClusterProvider sets a component for querying the current cluster state.
func (daemon *Daemon) SetClusterProvider(clusterProvider cluster.Provider) {
daemon.clusterProvider = clusterProvider
daemon.netController.SetClusterProvider(clusterProvider)
// call this in a goroutine to allow netcontroller handle this event async
// and not block if it is in the middle of talking with cluster
go daemon.netController.SetClusterProvider(clusterProvider)
}
// IsSwarmCompatible verifies if the current daemon