1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #1395 from LK4D4/fix_svc_race

network: fix race in read access to map
This commit is contained in:
Santhosh Manohar 2016-08-15 15:03:51 -07:00 committed by GitHub
commit 7a7112b794

View file

@ -1110,8 +1110,8 @@ func (n *network) getSvcRecords(ep *endpoint) []etchosts.Record {
epName := ep.Name() epName := ep.Name()
n.ctrlr.Lock() n.ctrlr.Lock()
defer n.ctrlr.Unlock()
sr, _ := n.ctrlr.svcRecords[n.id] sr, _ := n.ctrlr.svcRecords[n.id]
n.ctrlr.Unlock()
for h, ip := range sr.svcMap { for h, ip := range sr.svcMap {
if strings.Split(h, ".")[0] == epName { if strings.Split(h, ".")[0] == epName {