[oe-commits] [openembedded-core] 12/13: oeqa: tolerate interrupted select() while waiting for qemu

git at git.openembedded.org git at git.openembedded.org
Mon Mar 27 21:09:59 UTC 2017


This is an automated email from the git hooks/post-receive script.

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

commit d335aab85a1f5a73e4e03f81fcf4e556aa876730
Author: Patrick Ohly <patrick.ohly at intel.com>
AuthorDate: Mon Mar 27 15:03:22 2017 +0200

    oeqa: tolerate interrupted select() while waiting for qemu
    
    Sometimes, the OEQA utility code aborts with:
    
       ...
       File ".../meta/lib/oeqa/utils/qemurunner.py", line 131, in start
         return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams)
       File ".../meta/lib/oeqa/utils/qemurunner.py", line 259, in launch
         sread, swrite, serror = select.select(socklist, [], [], 5)
      InterruptedError: [Errno 4] Interrupted system call
    
    strace shows that this is because of a SIGWINCH:
    
       Connection from 127.0.0.1:52668
       select(21, [20], [], [], {5, 0})        = ? ERESTARTNOHAND (To be restarted if no handler)
       --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
    
    This is related to some special conditions:
     * whether qemu opens a graphical console window (enabled in Poky by default)
     * where that window gets opened
     * whether the window manager changes the size of the shell window (mine
       is a tiling window manager and reorders and resizes windows automatically)
    
    Ignoring the interrupted system calls avoids the problem. Code elsewhere (for example,
    run() in ssh.py) already does the same thing.
    
    Signed-off-by: Patrick Ohly <patrick.ohly at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/utils/qemurunner.py     | 10 ++++++++--
 meta/lib/oeqa/utils/qemutinyrunner.py |  5 ++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index cd79f21..ba44b96 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -256,7 +256,10 @@ class QemuRunner:
             bootlog = ''
             data = b''
             while time.time() < endtime and not stopread:
-                sread, swrite, serror = select.select(socklist, [], [], 5)
+                try:
+                    sread, swrite, serror = select.select(socklist, [], [], 5)
+                except InterruptedError:
+                    continue
                 for sock in sread:
                     if sock is self.server_socket:
                         qemusock, addr = self.server_socket.accept()
@@ -437,7 +440,10 @@ class QemuRunner:
             if now >= end:
                 data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout
                 break
-            sread, _, _ = select.select([self.server_socket],[],[], end - now)
+            try:
+                sread, _, _ = select.select([self.server_socket],[],[], end - now)
+            except InterruptedError:
+                continue
             if sread:
                 answer = self.server_socket.recv(1024)
                 if answer:
diff --git a/meta/lib/oeqa/utils/qemutinyrunner.py b/meta/lib/oeqa/utils/qemutinyrunner.py
index 34cb912..1bf5900 100644
--- a/meta/lib/oeqa/utils/qemutinyrunner.py
+++ b/meta/lib/oeqa/utils/qemutinyrunner.py
@@ -114,7 +114,10 @@ class QemuTinyRunner(QemuRunner):
         stopread = False
         endtime = time.time()+timeout
         while time.time()<endtime and not stopread:
-                sread, _, _ = select.select([self.server_socket],[],[],1)
+                try:
+                        sread, _, _ = select.select([self.server_socket],[],[],1)
+                except InterruptedError:
+                        continue
                 for sock in sread:
                         answer = sock.recv(1024)
                         if answer:

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


More information about the Openembedded-commits mailing list