aboutsummaryrefslogtreecommitdiffstats
path: root/lib/prserv
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-18 22:28:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-21 07:20:14 +0100
commit72a3dbe13a23588e24c0baca6d58c35cdeba3f63 (patch)
tree960c91715f28b03dc964b6b407ab38cc741a268a /lib/prserv
parent4e780fa19fc720948cf73133f56f7d837ad9283a (diff)
downloadbitbake-contrib-72a3dbe13a23588e24c0baca6d58c35cdeba3f63.tar.gz
server: Rework the server API so process and xmlrpc servers coexist
This changes the way bitbake server works quite radically. Now, the server is always a process based server with the option of starting an XMLRPC listener on a specific inferface/port. Behind the scenes this is done with a "bitbake.sock" file alongside the bitbake.lock file. If we can obtain the lock, we know we need to start a server. The server always listens on the socket and UIs can then connect to this. UIs connect by sending a set of three file descriptors over the domain socket, one for sending commands, one for receiving command results and the other for receiving events. These changes meant we can throw away all the horrid server abstraction code, the plugable transport option to bitbake and the code becomes much more readable and debuggable. It also likely removes a ton of ways you could hang the UI/cooker in weird ways due to all the race conditions that existed with previous processes. Changes: * The foreground option for bitbake-server was dropped. Just tail the log if you really want this, the codepaths were complicated enough without adding one for this. * BBSERVER="autodetect" was dropped. The server will autostart and autoconnect in process mode. You have to specify an xmlrpc server address since that can't be autodetected. I can't see a use case for autodetect now. * The transport/servetype option to bitbake was dropped. * A BB_SERVER_TIMEOUT variable is added which allows the server to stay resident for a period of time after the last client disconnects before unloading. This is used if the -T/--idle-timeout option is not passed to bitbake. This change is invasive and may well introduce new issues however I believe the codebase is in a much better position for further development and debugging. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/prserv')
-rw-r--r--lib/prserv/serv.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/prserv/serv.py b/lib/prserv/serv.py
index a7efa58bc..5f061c262 100644
--- a/lib/prserv/serv.py
+++ b/lib/prserv/serv.py
@@ -6,7 +6,7 @@ import queue
import socket
import io
import sqlite3
-import bb.server.xmlrpc
+import bb.server.xmlrpcclient
import prserv
import prserv.db
import errno
@@ -300,7 +300,7 @@ class PRServerConnection(object):
host, port = singleton.getinfo()
self.host = host
self.port = port
- self.connection, self.transport = bb.server.xmlrpc._create_server(self.host, self.port)
+ self.connection, self.transport = bb.server.xmlrpcclient._create_server(self.host, self.port)
def terminate(self):
try: