[oe-commits] [bitbake] branch master-next updated: process/cooker: Improve readypipe handling

git at git.openembedded.org git at git.openembedded.org
Mon Sep 11 22:53:19 UTC 2017


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

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

The following commit(s) were added to refs/heads/master-next by this push:
     new 60d4791  process/cooker: Improve readypipe handling
60d4791 is described below

commit 60d4791e3dd05729d2a2adf6f3b203c80d466a73
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Sep 11 23:17:43 2017 +0100

    process/cooker: Improve readypipe handling
    
    Issues in start are not being correctly detected by the current readypipe
    code. Change it to use specific "ready" or "fail" messages to correctly
    determine the correct failure mode and avoid bitbake seeming to hang
    (it does currently timeout eventually).
    
    [YOCTO #12062]
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/cooker.py         |  6 +-----
 lib/bb/server/process.py | 17 +++++++++++++----
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 7d040dc..8fe36eb 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -165,7 +165,7 @@ class BBCooker:
     Manages one bitbake build run
     """
 
-    def __init__(self, configuration, featureSet=None, readypipe=None):
+    def __init__(self, configuration, featureSet=None):
         self.recipecaches = None
         self.skiplist = {}
         self.featureset = CookerFeatures()
@@ -233,10 +233,6 @@ class BBCooker:
         # Let SIGHUP exit as SIGTERM
         signal.signal(signal.SIGHUP, self.sigterm_exception)
 
-        if readypipe:
-            os.write(readypipe, b"ready")
-            os.close(readypipe)
-
     def process_inotify_updates(self):
         for n in [self.confignotifier, self.notifier]:
             if n.check_events(timeout=0):
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 5c7dfae..6a12f01 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -388,8 +388,10 @@ class BitBakeServer(object):
         self.bitbake_lock.close()
 
         ready = ConnectionReader(self.readypipe)
-        r = ready.wait(30)
-        if not r:
+        r = ready.poll(30)
+        if r:
+            r = ready.get()
+        if not r or r != "ready":
             ready.close()
             bb.error("Unable to start bitbake server")
             if os.path.exists(logfile):
@@ -404,8 +406,15 @@ class BitBakeServer(object):
         print("Starting bitbake server pid %d" % os.getpid())
         server = ProcessServer(self.bitbake_lock, self.sock, self.sockname)
         self.configuration.setServerRegIdleCallback(server.register_idle_function)
-
-        self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset, self.readypipein)
+        writer = ConnectionWriter(self.readypipein)
+        try:
+            self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
+            writer.send("ready")
+        except:
+            writer.send("fail")
+            raise
+        finally:
+            os.close(self.readypipein)
         server.cooker = self.cooker
         server.server_timeout = self.configuration.server_timeout
         server.xmlrpcinterface = self.configuration.xmlrpcinterface

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


More information about the Openembedded-commits mailing list