Skip to content

Commit 20351a8

Browse files
committed
Merge pull request #721 from sanimej/bfix
Fix an issue in overlay network peer EP list maintenance
2 parents e430544 + 02aa79f commit 20351a8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

store.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ func (c *controller) networkWatchLoop(nw *netWatch, ep *endpoint, ecCh <-chan da
265265
var addEp []*endpoint
266266

267267
delEpMap := make(map[string]*endpoint)
268+
renameEpMap := make(map[string]bool)
268269
for k, v := range nw.remoteEps {
269270
delEpMap[k] = v
270271
}
@@ -285,10 +286,20 @@ func (c *controller) networkWatchLoop(nw *netWatch, ep *endpoint, ecCh <-chan da
285286
delete(delEpMap, lEp.ID())
286287
continue
287288
}
289+
renameEpMap[lEp.ID()] = true
288290
}
289291
nw.remoteEps[lEp.ID()] = lEp
290292
addEp = append(addEp, lEp)
291293
}
294+
295+
// EPs whose name are to be deleted from the svc records
296+
// should also be removed from nw's remote EP list, except
297+
// the ones that are getting renamed.
298+
for _, lEp := range delEpMap {
299+
if !renameEpMap[lEp.ID()] {
300+
delete(nw.remoteEps, lEp.ID())
301+
}
302+
}
292303
c.Unlock()
293304

294305
for _, lEp := range delEpMap {

0 commit comments

Comments
 (0)