mirror of
https://git.yoctoproject.org/poky
synced 2026-02-10 18:53:13 +01:00
oeqa/sshcontrol: Handle empty reads
Looking at some of the autobuilder failures, it seems that somehow empty reads might be possible despite not being EOF. Tweak the code to be a little more robust in handling this. In theory this shouldn't be possible but python does handle signals a bit differently (e.g. transparrently retrying syscalls for EINTR) so adding this check and a bit of code safety at least rules out this problem. (From OE-Core rev: 9d91a5674c515a43ae76d8615f72e5e2dc16c961) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -57,8 +57,10 @@ class SSHProcess(object):
|
||||
if select.select([self.process.stdout], [], [], 5)[0] != []:
|
||||
data = os.read(self.process.stdout.fileno(), 1024)
|
||||
if not data:
|
||||
self.process.stdout.close()
|
||||
eof = True
|
||||
self.process.poll()
|
||||
if self.process.returncode is None:
|
||||
self.process.stdout.close()
|
||||
eof = True
|
||||
else:
|
||||
data = data.decode("utf-8")
|
||||
output += data
|
||||
|
||||
Reference in New Issue
Block a user