summaryrefslogtreecommitdiffstats
path: root/lib/bb/server/xmlrpc.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-03-17 11:34:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-24 12:30:38 +0000
commitafc0dd5c532684f6201b1e12bbf4c226ea19062d (patch)
treef59a436a799ff6557d1ecf58a29d17110ada29f6 /lib/bb/server/xmlrpc.py
parentbdad45ebe551912b055ffa349d254ae5947a3ba6 (diff)
downloadbitbake-contrib-afc0dd5c532684f6201b1e12bbf4c226ea19062d.tar.gz
bitbake: xmlrpc: set single use mode differently
Currently xmlrpc server implicitly sets itself into single use mode when bitbake server is started with anonymous port (0) or no port is provided in command line. In this mode bitbake shuts down xmlrpc server after build is done. This assumption is incorrect in some cases. For example Toaster uses bitbake in this mode and expects xmlrpc server to stay in memory. Till recent changes single use mode was always unset due to the bug. When the bug was fixed it broke toaster builds as Toaster couldn't communicate with bitbake server in single use mode. Reimplemented logic of setting single use mode. The mode is explicity set when --server-only command line parameter is not provided to bitbake. It doesn't depend on the port number anymore. [YOCTO #9275] [YOCTO #9240] [YOCTO #9252] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/server/xmlrpc.py')
-rw-r--r--lib/bb/server/xmlrpc.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bb/server/xmlrpc.py b/lib/bb/server/xmlrpc.py
index 752813874..ace1cf646 100644
--- a/lib/bb/server/xmlrpc.py
+++ b/lib/bb/server/xmlrpc.py
@@ -186,12 +186,12 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
# remove this when you're done with debugging
# allow_reuse_address = True
- def __init__(self, interface):
+ def __init__(self, interface, single_use=False):
"""
Constructor
"""
BaseImplServer.__init__(self)
- self.single_use = interface[1] == 0 # anonymous port, not getting reused
+ self.single_use = single_use
# Use auto port configuration
if (interface[1] == -1):
interface = (interface[0], 0)
@@ -332,9 +332,9 @@ class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection):
pass
class BitBakeServer(BitBakeBaseServer):
- def initServer(self, interface = ("localhost", 0)):
+ def initServer(self, interface = ("localhost", 0), single_use = False):
self.interface = interface
- self.serverImpl = XMLRPCServer(interface)
+ self.serverImpl = XMLRPCServer(interface, single_use)
def detach(self):
daemonize.createDaemon(self.serverImpl.serve_forever, "bitbake-cookerdaemon.log")