From Yaniv Bronhaim <ybronhei(a)redhat.com>:
Yaniv Bronhaim has posted comments on this change.
Change subject: [RFC] procutils: Introduce the procutils module
......................................................................
Patch Set 8:
(2 comments)
https://gerrit.ovirt.org/#/c/74927/8/lib/vdsm/common/procutils.py
File lib/vdsm/common/procutils.py:
Line 115:
Line 116: _wait(p, deadline)
Line 117:
Line 118:
Line 119: def _wait(p, deadline=None):
No no, this is a deadline, not a timeout - check how we treat it in
line 13
how? if deadline-time<=0 you raise timeoutExpire. should it be
deadlineReached?
Line 120: """
Line 121: Wait until process terminate or if deadline is specified,
Line 122: utils.monotonic_time() exceeeds deadline.
Line 123: """
Line 124: log.debug("Waiting for process (pid=%d)", p.pid)
Line 125: if deadline is None:
Line 126: p.wait()
Line 127: else:
Line 128: timeout = 1.0 / 2**8
Why is it better to use integers? how do you suggest to use a
counter?
don't you just count here for 1 to 8, then you can multiply it by IN
MILISECOND\IN SECONDS in the sleep call
Line 129: while p.poll() is None:
Line 130: remaining = deadline - utils.monotonic_time()
Line 131: if remaining <= 0:
Line 132: raise TimeoutExpired(p.pid)
--
To view, visit
https://gerrit.ovirt.org/74927
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I7d193caa5da0ed564b4fab12aa85e3751f1a1df7
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Denis Chaplygin <dchaplyg(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes