Martin Sivák has uploaded a new change for review. Change subject: Use monotonic time to compute intervals in broker's submonitors ......................................................................
Use monotonic time to compute intervals in broker's submonitors The submonitors stopped reporting data when the system time on a host was moved backwards. Change-Id: I775ec7b9f11b253d06c45eb01a765123088944aa Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1036683 Signed-off-by: Martin Sivak <m...@montik.net> (cherry picked from commit a77563b17962aa36680605669d2a774c9b3aea00) --- M ovirt_hosted_engine_ha/broker/submonitor_base.py 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-ha refs/changes/69/33769/1 diff --git a/ovirt_hosted_engine_ha/broker/submonitor_base.py b/ovirt_hosted_engine_ha/broker/submonitor_base.py index 87ede0d..11b28d3 100644 --- a/ovirt_hosted_engine_ha/broker/submonitor_base.py +++ b/ovirt_hosted_engine_ha/broker/submonitor_base.py @@ -20,6 +20,7 @@ import logging import threading import time +from ..lib import monotonic class SubmonitorBase(object): @@ -109,7 +110,7 @@ self._initialized.set() while self._execute: - next_execution = time.time() + self._interval + next_execution = monotonic.time() + self._interval try: self.action(self._options) except Exception as e: @@ -117,10 +118,10 @@ self._baselog.error("Error executing submonitor %s, args %r", self._name, self._options, exc_info=True) pass - time_remaining = next_execution - time.time() + time_remaining = next_execution - monotonic.time() while time_remaining > 0: time.sleep(time_remaining) - time_remaining = next_execution - time.time() + time_remaining = next_execution - monotonic.time() self.teardown(self._options) def stop(self): -- To view, visit http://gerrit.ovirt.org/33769 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I775ec7b9f11b253d06c45eb01a765123088944aa Gerrit-PatchSet: 1 Gerrit-Project: ovirt-hosted-engine-ha Gerrit-Branch: ovirt-hosted-engine-ha-1.2 Gerrit-Owner: Martin Sivák <msi...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches