-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Flavio Crisciani
committed
May 4, 2017
1 parent
8c113c7
commit a2bf0b3
Showing
5 changed files
with
121 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.