Commit b44b0141 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix bug introduced in commit 413b7472

While commit 413b7472

 fixed the issue of poll(2) returning too
soon, it didn't work when the poll(2) call should've been
blocking. This is now fixed and verified.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 413b7472
......@@ -141,12 +141,15 @@ class _SingleNotifyPipeConditionWaiter(object):
while True:
remaining_time = running_timeout.Remaining()
if remaining_time is not None and remaining_time < 0.0:
break
if remaining_time is not None:
if remaining_time < 0.0:
break
try:
# Our calculation uses seconds, poll() wants milliseconds
result = self._poller.poll(1000 * remaining_time)
remaining_time *= 1000
try:
result = self._poller.poll(remaining_time)
except EnvironmentError, err:
if err.errno != errno.EINTR:
raise
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment