Change in vdsm[master]: utils.retry: Support system time changes while retry() is ru...

danken at redhat.com danken at redhat.com
Sat Sep 19 14:41:03 UTC 2015


Dan Kenigsberg has submitted this change and it was merged.

Change subject: utils.retry: Support system time changes while retry() is running
......................................................................


utils.retry: Support system time changes while retry() is running

In a scenario where retry() is called with timeout (>0) and
during the retry run, the system time changes, the timeout calculation
will get corrupted. This may cause an unwanted result.

At the function entry point, the system time is saved (time.time())
and used after each retry attempt to calculate the period passed.
If the system time is changed between the first time call and the
following time calls, the delta time will get corrupted.

The calculated delta time, which gets compared to the timeout value,
should not be affected by the system time change.
To support that, a monotonic timer is used.

Change-Id: I6bc072bc20e8f5ae2db3fd1e48d91cdce9d469f8
Signed-off-by: Edward Haas <edwardh.dev at gmail.com>
Reviewed-on: https://gerrit.ovirt.org/46075
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-by: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Continuous-Integration: Dan Kenigsberg <danken at redhat.com>
---
M lib/vdsm/utils.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Nir Soffer: Looks good to me, but someone else must approve
  Yaniv Bronhaim: Looks good to me, but someone else must approve
  Edward Haas: Verified
  Dan Kenigsberg: Looks good to me, approved; Passed CI tests



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6bc072bc20e8f5ae2db3fd1e48d91cdce9d469f8
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh.dev at gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh.dev at gmail.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org


More information about the vdsm-patches mailing list