summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-03 23:34:05 -0800
committerZac Medico <zmedico@gentoo.org>2013-01-03 23:34:05 -0800
commit60cfa786a1506e5fccfb02c3307c38399b5a532f (patch)
treeccc94863b8d905990e95e413f08b2aa746827057 /bin
parent6eff7ea1d28da8af9a30a5b8c1dcd05ed9b7638d (diff)
downloadportage-60cfa786a1506e5fccfb02c3307c38399b5a532f.tar.gz
portage-60cfa786a1506e5fccfb02c3307c38399b5a532f.tar.bz2
portage-60cfa786a1506e5fccfb02c3307c38399b5a532f.zip
ebuild-ipc: fix read timeout msg / daemon check
It got disabled in commit 06d31ef00da24352a6614f20bccfc892d2120ed9.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild-ipc.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index ca707fa98..4046d8d25 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -145,12 +145,26 @@ class EbuildIpc(object):
def _receive_reply(self, input_fd):
- buf = None
+ start_time = time.time()
pipe_reader = PipeReader(input_files={"input_fd":input_fd},
scheduler=global_event_loop())
pipe_reader.start()
- pipe_reader.wait()
+
+ eof = pipe_reader.poll() is not None
+
+ while not eof:
+ pipe_reader._wait_loop(timeout=self._COMMUNICATE_RETRY_TIMEOUT_MS)
+ eof = pipe_reader.poll() is not None
+ if not eof:
+ if self._daemon_is_alive():
+ self._timeout_retry_msg(start_time,
+ portage.localization._('during read'))
+ else:
+ pipe_reader.cancel()
+ self._no_daemon_msg()
+ return 2
+
buf = pipe_reader.getvalue()
retval = 2