Fixing a race condition that caused a Panic when deleting overlay network then quickly leaving swarm.
This issue was uncovered in TestOverlayAttachableReleaseResourcesOnFailure. Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
This commit is contained in:
parent
cc08cacfab
commit
495252723d
1 changed files with 7 additions and 0 deletions
|
@ -916,6 +916,13 @@ func (sb *sandbox) clearNetworkResources(origEp *endpoint) error {
|
|||
break
|
||||
}
|
||||
}
|
||||
|
||||
if index == -1 {
|
||||
logrus.Errorf("Endpoint %s has already been deleted", ep.Name())
|
||||
sb.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
heap.Remove(&sb.endpoints, index)
|
||||
for _, e := range sb.endpoints {
|
||||
if len(e.Gateway()) > 0 {
|
||||
|
|
Loading…
Add table
Reference in a new issue