]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
main: kill server without queue setup
authorEd Bartosh <ed.bartosh@linux.intel.com>
Tue, 5 Jan 2016 13:45:38 +0000 (15:45 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Jan 2016 17:59:16 +0000 (17:59 +0000)
Setup of event queue includes registering of UI handler.
This operation can fail when cooker is busy. However, there is
no need in registering UI handler for terminating the server.

Moved the call of connection.terminateServer before setting up
of the event queue. This should make terminating server to work
more reliably as it doesn't depend on setting up the event queue
and registering UI handler anymore.

This should also help Toaster backend to restart bitbake server
and observer without getting "Could not register UI event handler"
errors.

[YOCTO #8776]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/main.py

index dd0439391e9e716f6a7d8d071438ac8013408177..c0ae38ab6ddbd692cba5c2afef883bc9fce4ca66 100755 (executable)
@@ -403,10 +403,16 @@ def bitbake_main(configParams, configuration):
     if not configParams.server_only:
         try:
             server_connection = server.establishConnection(featureset)
-            server_connection.setupEventQueue()
         except Exception as e:
             bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e)))
 
+        if configParams.kill_server:
+            server_connection.connection.terminateServer()
+            bb.event.ui_queue = []
+            return 0
+
+        server_connection.setupEventQueue()
+
         # Restore the environment in case the UI needs it
         for k in cleanedvars:
             os.environ[k] = cleanedvars[k]
@@ -418,11 +424,6 @@ def bitbake_main(configParams, configuration):
             server_connection.terminate()
             return 0
 
-        if configParams.kill_server:
-            server_connection.connection.terminateServer()
-            bb.event.ui_queue = []
-            return 0
-
         try:
             return ui_module.main(server_connection.connection, server_connection.events, configParams)
         finally: