Change in vdsm[master]: Cache the result of numaUtils.getVcpuPids

fromani at redhat.com fromani at redhat.com
Mon May 11 07:08:52 UTC 2015


Francesco Romani has posted comments on this change.

Change subject: Cache the result of numaUtils.getVcpuPids
......................................................................


Patch Set 7: Code-Review+1

(2 comments)

codewise, good enough for me. Will need a rebase.

https://gerrit.ovirt.org/#/c/38564/7/vdsm/numaUtils.py
File vdsm/numaUtils.py:

Line 39:     path = _libvirt_xml_path(vmName)
Line 40:     try:
Line 41:         del _libvirt_vcpu_pids_cache[path]
Line 42:     except KeyError:
Line 43:         pass  # ignore
Just a note: I run into a similar situation for my bulk stats patch. Ended up catching the exception (and ignoring it) in the caller.
Line 44: 
Line 45: 
Line 46: # TODO update to API calls once bug
Line 47: #      https://bugzilla.redhat.com/show_bug.cgi?id=1211518


Line 53:     try:
Line 54:         if path in _libvirt_vcpu_pids_cache:
Line 55:             lastmtime, value = _libvirt_vcpu_pids_cache[path]
Line 56:             if lastmtime == mtime:
Line 57:                 return value
> I did not want to handle the expected case of empty cache using the excepti
ook for me
Line 58:     except KeyError:
Line 59:         # Make sure we do not crash if the cache is suddenly
Line 60:         # invalidated
Line 61:         pass


-- 
To view, visit https://gerrit.ovirt.org/38564
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I135143bccdd29697ec673819212193c0fc217e56
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list