Francesco Romani has uploaded a new change for review.
Change subject: WIP: statscache: support multiple removals ......................................................................
WIP: statscache: support multiple removals
There is a still obscure bug that causes multiple removals from cache, and everyone but the first will fail (as expected).
This patch handles this case, until either we pinpoint the bug, or the actual need for supporting multiple removals.
Change-Id: I1748cba3646341d2be799aaf30b81432b009359c Signed-off-by: Francesco Romani fromani@redhat.com --- M vdsm/virt/sampling.py 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/40439/1
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py index bb2f462..455f49e 100644 --- a/vdsm/virt/sampling.py +++ b/vdsm/virt/sampling.py @@ -425,7 +425,10 @@ Remove any data from the cache related to the given VM. """ with self._lock: - del self._vm_last_timestamp[vmid] + ts = self._vm_last_timestamp.pop(vmid, None) + + if ts is None: + self._log.warn('timestamp for vm %s already removed', vmid)
def get(self, vmid): """