moby/libnetwork/config
Flavio Crisciani a2bf0b35d6 Fix for swarm/libnetwork init race condition
This change cleans up the SetClusterProvider method.
Swarm calls the SetClusterProvider to pass to libnetwork the pointer
of the provider from which libnetwork can fetch all the information to
initialize the internal agent.

The method can be and is called multiple times passing the same value,
with the previous logic that was erroneusly spawning multiple go routines that
were making possiblea race between an agentInit and an agentClose.

The new logic aims to disallow it by checking for the provider passed and
ensuring that if the provider is already present there is nothing to do because
there is already an active go routine that is ready to process cluster events.
Moreover a patch on moby side takes care of clearing up the Cluster Events
dispacthing using only 1 channel to handle all the events types.
This will also guarantee in order event handling because now all the events are
piped into one single channel.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-04 15:35:28 -07:00
..
config.go Fix for swarm/libnetwork init race condition 2017-05-04 15:35:28 -07:00
config_test.go Revert "validate network and endpoint name more strictly" 2017-02-01 18:18:17 -08:00
libnetwork.toml TOML based Configuration support for libnetwork 2015-05-25 16:29:40 -07:00