[OE-core] [PATCHv3 04/30] bb/server/process: Handle EINTR on idle_commands select

Aníbal Limón anibal.limon at linux.intel.com
Mon Jul 17 21:45:12 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>
---
 bitbake/lib/bb/server/process.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index f8d67678558..a8ba4681c64 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/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 Openembedded-core mailing list