From 2b3f9b302b633a2ef5805b39b6ebce4d8d56050c Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Fri, 6 May 2016 18:38:56 -0700 Subject: [PATCH] Set persist flag on the dummy network object during cleanup During sandboxcleanup operation, a dummy object is created if the kv-store is inaccessible during the daemon bootup. The dummy object is used for local processing of sandbox/endpoint cleanup operation. But unfortunately, since the persist flag was not set, the Skip() functionality kicked-in when sandbox was written back to the store and global endpoint was skipped to be tracked. During a subsequent cleanup operation, sandbox was removed and the global endpoint was left stale in the kv-store. The fix is to set the persist flag in the dummy object and that handles the sandbox and endpoint states appropriately and endpoint object is properly cleaned up when the KVStore becomes available. Signed-off-by: Madhu Venugopal --- sandbox_store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sandbox_store.go b/sandbox_store.go index 442aad1009..ae5ddc1566 100644 --- a/sandbox_store.go +++ b/sandbox_store.go @@ -213,7 +213,7 @@ func (c *controller) sandboxCleanup() { var ep *endpoint if err != nil { logrus.Errorf("getNetworkFromStore for nid %s failed while trying to build sandbox for cleanup: %v", eps.Nid, err) - n = &network{id: eps.Nid, ctrlr: c, drvOnce: &sync.Once{}} + n = &network{id: eps.Nid, ctrlr: c, drvOnce: &sync.Once{}, persist: true} ep = &endpoint{id: eps.Eid, network: n, sandboxID: sbs.ID} } else { ep, err = n.getEndpointFromStore(eps.Eid)