[bitbake-devel] [PATCH 1/2] bb/server/process: Handle EINTR on idle_commands select

Aníbal Limón anibal.limon at linux.intel.com
Mon Jul 17 21:37:23 UTC 2017


If a signal is sent like SIGWINCH the select could be interrupted
so ignore the InterruptError like in XMLRPC server [1].

[1]
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/bb/server/xmlrpc.py#n307

Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
---
 lib/bb/server/process.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index f8d67678..a8ba4681 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -186,7 +186,12 @@ class ProcessServer(Process, BaseImplServer):
             nextsleep = self.next_heartbeat - now
 
         if nextsleep is not None:
-            select.select(fds,[],[],nextsleep)
+            try:
+                select.select(fds,[],[],nextsleep)
+            except InterruptedError:
+                # ignore EINTR error, nextsleep only used for wait
+                # certain time
+                pass
 
     def runCommand(self, command):
         """
-- 
2.11.0




More information about the bitbake-devel mailing list