Francesco Romani has posted comments on this change.

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


Patch Set 7:

(1 comment)

thanks for the updates. Do we have specific unit tests for the cache (e.g. 
value fetched from the cache, cache invalidation)?

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

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
quite minor:

due to onQemuDeath, we need to catch KeyError. But now this can be rewritten as

  lastmtime, value = _libvirt_vcpu_pids_cache[path]
  if lastmtime == mtime:
      return value
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 <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to