[oe-commits] [openembedded-core] 23/23: oeqa/sshcontrol: Handle interrupted system call error

git at git.openembedded.org git at git.openembedded.org
Thu Oct 6 21:46:00 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit f6cbe143441a103a16ae6b94b2454a51ed8b1159
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Oct 3 15:56:13 2016 +0100

    oeqa/sshcontrol: Handle interrupted system call error
    
    Deal with an interrupted system call gracefully:
    
    |   File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/utils/sshcontrol.py", line 55, in _run
    |     if select.select([self.process.stdout], [], [], 5)[0] != []:
    | InterruptedError: [Errno 4] Interrupted system call
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/utils/sshcontrol.py | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
index da485ee..05d6502 100644
--- a/meta/lib/oeqa/utils/sshcontrol.py
+++ b/meta/lib/oeqa/utils/sshcontrol.py
@@ -52,17 +52,19 @@ class SSHProcess(object):
             endtime = self.starttime + timeout
             eof = False
             while time.time() < endtime and not eof:
-                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
-                    else:
-                        data = data.decode("utf-8")
-                        output += data
-                        self.log(data)
-                        endtime = time.time() + timeout
-
+                try:
+                    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
+                        else:
+                            data = data.decode("utf-8")
+                            output += data
+                            self.log(data)
+                            endtime = time.time() + timeout
+                except InterruptedError:
+                    continue
 
             # process hasn't returned yet
             if not eof:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list