From: Zac Medico Date: Fri, 4 Jan 2013 07:34:05 +0000 (-0800) Subject: ebuild-ipc: fix read timeout msg / daemon check X-Git-Tag: v2.2.0_alpha150~39 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=60cfa786a1506e5fccfb02c3307c38399b5a532f;p=portage.git ebuild-ipc: fix read timeout msg / daemon check It got disabled in commit 06d31ef00da24352a6614f20bccfc892d2120ed9. --- 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