Browse Source

Merge pull request #860 from LK4D4/fix_ctrlr_race

Fix race in setting ctrlr for network
Jana Radhakrishnan 9 years ago
parent
commit
ad14618fc0
1 changed files with 2 additions and 0 deletions
  1. 2 0
      libnetwork/store.go

+ 2 - 0
libnetwork/store.go

@@ -129,7 +129,9 @@ func (c *controller) getNetworksFromStore() ([]*network, error) {
 
 		for _, kvo := range kvol {
 			n := kvo.(*network)
+			n.Lock()
 			n.ctrlr = c
+			n.Unlock()
 
 			ec := &endpointCnt{n: n}
 			err = store.GetObject(datastore.Key(ec.Key()...), ec)