Skip to content

Commit

Permalink
CleanupBindings before leaving gossip cluster
Browse files Browse the repository at this point in the history
Turned out that leaving the gossip cluster before cleaning up the bindings
does not propagate the appropriate table events leaving other nodes with stale
entries.
This commit anticipate the logic to cleanup the bindings before leaving the
gossip cluster

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
  • Loading branch information
Flavio Crisciani committed Jun 8, 2017
1 parent cc85bea commit 49f2a16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -985,12 +985,13 @@ func (n *network) delete(force bool) error {
// before deleting the network from the store since service
// bindings cleanup requires the network in the store.
n.cancelDriverWatches()

c.cleanupServiceBindings(n.ID())

if err = n.leaveCluster(); err != nil {
logrus.Errorf("Failed leaving network %s from the agent cluster: %v", n.Name(), err)
}

c.cleanupServiceBindings(n.ID())

removeFromStore:
// deleteFromStore performs an atomic delete operation and the
// network.epCnt will help prevent any possible
Expand Down

0 comments on commit 49f2a16

Please sign in to comment.