Change in vdsm[master]: WIP: RFC: track domain availability
fromani at redhat.com
fromani at redhat.com
Thu Aug 6 07:52:47 UTC 2015
Francesco Romani has posted comments on this change.
Change subject: WIP: RFC: track domain availability
......................................................................
Patch Set 2:
(5 comments)
https://gerrit.ovirt.org/#/c/44401/2/tests/periodicTests.py
File tests/periodicTests.py:
Line 230: vm_id = _fake_vm_id(i)
Line 231: with self.cif.vmContainerLock:
Line 232: self.cif.vmContainer[vm_id] = _FakeVM(
Line 233: vm_id, vm_id)
Line 234:
this hink should be moved in the parent patch
Line 235:
Line 236: def _fake_vm_id(i):
Line 237: return 'VM-%03i' % i
Line 238:
https://gerrit.ovirt.org/#/c/44401/2/vdsm/virt/periodic.py
File vdsm/virt/periodic.py:
Line 31: from vdsm.config import config
Line 32: from vdsm.utils import monotonic_time
Line 33:
Line 34: from . import sampling
Line 35: from .utils import ResourceTracker, ResourceBusy
"ResourceTracker" is a little ugly
Line 36:
Line 37:
Line 38: # just a made up number. Maybe should be equal to number of cores?
Line 39: # TODO: make them tunable through private, unsupported configuration items
Line 279: self._vm.log.warning('could not run %s on %s: domain was busy',
Line 280: self, self._vm.id)
Line 281: else:
Line 282: self._execute()
Line 283: self._teardown()
execute() can raise as well.
Should be
try:
self.setup()
except ResourceBusy:
# comment doc
self._vm.log.warning(...)
return
try:
self.execute()
finally:
self.teardown()
Line 284:
Line 285: def ondiscard(self):
Line 286: self._teardown()
Line 287:
https://gerrit.ovirt.org/#/c/44401/2/vdsm/virt/sampling.py
File vdsm/virt/sampling.py:
Line 516: # *is* costly so we should avoid it if we can.
Line 517: available, total = self._tracker.resources()
Line 518: fast_path = (
Line 519: self._sampling.acquire(blocking=False)
Line 520: and len(available) == len(total)
explain
Line 521: and not self._skip_doms)
Line 522: try:
Line 523: if fast_path:
Line 524: # This is expected to be the common case.
https://gerrit.ovirt.org/#/c/44401/2/vdsm/virt/utils.py
File vdsm/virt/utils.py:
Line 116: def cleanup_guest_socket(sock):
Line 117: if os.path.islink(sock):
Line 118: rmFile(os.path.realpath(sock))
Line 119: rmFile(sock)
Line 120:
lacks unit tests
Line 121:
Line 122: class ResourceBusy(Exception):
Line 123: pass
Line 124:
--
To view, visit https://gerrit.ovirt.org/44401
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9b8802861e47c78b7ed330dcfe4e42f930766fda
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list