Nir Soffer has posted comments on this change.
Change subject: schedule: Introduce scheduling library ......................................................................
Patch Set 23:
(2 comments)
http://gerrit.ovirt.org/#/c/29607/23/lib/vdsm/schedule.py File lib/vdsm/schedule.py:
Line 109: Line 110: Returns a ScheduledCall that may be canceled if callable was not called Line 111: yet. Line 112: """ Line 113: deadline = time.time() + delay
now we can use monotonic_time(), just in case someone plays with the system
monotonic_time() resolution is only 10 milliseconds, so this will delay wakeups for no benefit most of the time. System time changes on a machine with ntp are practically non-issue in the context of this scheduler.
In python 3, we can use the real thing implemented with clock_gettime instead of our os.times hack. Line 114: call = ScheduledCall(callable) Line 115: with self._cond: Line 116: if not self._running: Line 117: raise AssertionError("Scheduler not running")
Line 123: Line 124: @utils.traceback(on=_log.name) Line 125: def _run(self): Line 126: try: Line 127: self._log.debug("started")
strictly speaking, first log should be out of the try block
Done Line 128: self._loop() Line 129: self._log.debug("stopped") Line 130: finally: Line 131: self._cancel_calls()