Change in vdsm[master]: status: adding elapsed time in millis
danken at redhat.com
danken at redhat.com
Thu Jun 11 11:20:15 UTC 2015
Dan Kenigsberg has posted comments on this change.
Change subject: status: adding elapsed time in millis
......................................................................
Patch Set 17: Code-Review-1
(3 comments)
https://gerrit.ovirt.org/#/c/40904/17//COMMIT_MSG
Commit Message:
Line 3: AuthorDate: 2015-05-13 17:44:59 +0200
Line 4: Commit: pkliczewski <piotr.kliczewski at gmail.com>
Line 5: CommitDate: 2015-06-10 17:23:33 +0200
Line 6:
Line 7: status: adding elapsed time in millis
virt: adding statusTime in milliseconds
Line 8:
Line 9: When sending vm status changes to the engine we can not guarantee the
Line 10: ordering. We use monotonic time to determine the order for single host
Line 11: and migration flow is solved on the engine side to sort out differences
https://gerrit.ovirt.org/#/c/40904/17/vdsm/rpc/vdsmapi-schema.json
File vdsm/rpc/vdsmapi-schema.json:
Line 6988: milise
mili -> milli
https://gerrit.ovirt.org/#/c/40904/17/vdsm/virt/vm.py
File vdsm/virt/vm.py:
Line 1289: def status(self, fullStatus=True):
Line 1290: # used by API.Global.getVMList
Line 1291: if not fullStatus:
Line 1292: return {'vmId': self.id, 'status': self.lastStatus,
Line 1293: 'statusTime': self._get_status_time()}
this should not be calculated now, when the status is polled, but earlier, when a new value was set to lastStatus.
Whenever lastStatus is written to, we should take a lock, and cache the time of the change.
Whenever you need to read the status, take the same lock, and read both status and its statusTime.
This is the only race-free way I can thinks of, and frankly - it seems simpler.
Line 1294:
Line 1295: self.conf['status'] = self.lastStatus
Line 1296: with self._confLock:
Line 1297: # Filter out any internal keys
--
To view, visit https://gerrit.ovirt.org/40904
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I38727e0eac7cb29c1dc7c9696568540b6545461c
Gerrit-PatchSet: 17
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list