Merge pull request #860 from LK4D4/fix_ctrlr_race

Fix race in setting ctrlr for network
This commit is contained in:
Jana Radhakrishnan 2016-01-12 11:09:02 -08:00
commit ad14618fc0
1 changed files with 2 additions and 0 deletions

View File

@ -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)