diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-01-24 15:26:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-01-25 11:30:31 +0000 |
commit | bdecbe35d80eea96bca96fe34a4b9dc372d8f752 (patch) | |
tree | b129fa8d75dea2d054d058aa6e3e89e36c562079 /meta/lib | |
parent | 59db27de565fb33f9e4326e76ebd6fa3935557b9 (diff) | |
download | poky-bdecbe35d80eea96bca96fe34a4b9dc372d8f752.tar.gz |
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>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/utils/sshcontrol.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py index 36c2ecb3db..6c5648779a 100644 --- a/meta/lib/oeqa/utils/sshcontrol.py +++ b/meta/lib/oeqa/utils/sshcontrol.py | |||
@@ -57,8 +57,10 @@ class SSHProcess(object): | |||
57 | if select.select([self.process.stdout], [], [], 5)[0] != []: | 57 | if select.select([self.process.stdout], [], [], 5)[0] != []: |
58 | data = os.read(self.process.stdout.fileno(), 1024) | 58 | data = os.read(self.process.stdout.fileno(), 1024) |
59 | if not data: | 59 | if not data: |
60 | self.process.stdout.close() | 60 | self.process.poll() |
61 | eof = True | 61 | if self.process.returncode is None: |
62 | self.process.stdout.close() | ||
63 | eof = True | ||
62 | else: | 64 | else: |
63 | data = data.decode("utf-8") | 65 | data = data.decode("utf-8") |
64 | output += data | 66 | output += data |