summaryrefslogtreecommitdiffstats
path: root/bitbake
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:31:50 +0000
commitb58e5b1fb3bcacbcfce17a748bca5f60c3528b4f (patch)
tree8c502e418b514d4eabc5ba63cc3c309ded6a68d8 /bitbake
parent2df514bfe4a911c0dca8828038dd94e6265f50ca (diff)
downloadpoky-b58e5b1fb3bcacbcfce17a748bca5f60c3528b4f.tar.gz
bitbake: 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] (Bitbake rev: afc0dd5c532684f6201b1e12bbf4c226ea19062d) 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 'bitbake')
-rwxr-xr-xbitbake/lib/bb/main.py5
-rw-r--r--bitbake/lib/bb/server/process.py2
-rw-r--r--bitbake/lib/bb/server/xmlrpc.py8
3 files changed, 8 insertions, 7 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index bf59793db5..a28c7514df 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -282,12 +282,13 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
282 282
283def start_server(servermodule, configParams, configuration, features): 283def start_server(servermodule, configParams, configuration, features):
284 server = servermodule.BitBakeServer() 284 server = servermodule.BitBakeServer()
285 single_use = not configParams.server_only
285 if configParams.bind: 286 if configParams.bind:
286 (host, port) = configParams.bind.split(':') 287 (host, port) = configParams.bind.split(':')
287 server.initServer((host, int(port))) 288 server.initServer((host, int(port)), single_use)
288 configuration.interface = [ server.serverImpl.host, server.serverImpl.port ] 289 configuration.interface = [ server.serverImpl.host, server.serverImpl.port ]
289 else: 290 else:
290 server.initServer() 291 server.initServer(single_use=single_use)
291 configuration.interface = [] 292 configuration.interface = []
292 293
293 try: 294 try:
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index e387b30ee3..a3078a873d 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -242,7 +242,7 @@ class ProcessEventQueue(multiprocessing.queues.Queue):
242 242
243 243
244class BitBakeServer(BitBakeBaseServer): 244class BitBakeServer(BitBakeBaseServer):
245 def initServer(self): 245 def initServer(self, single_use=True):
246 # establish communication channels. We use bidirectional pipes for 246 # establish communication channels. We use bidirectional pipes for
247 # ui <--> server command/response pairs 247 # ui <--> server command/response pairs
248 # and a queue for server -> ui event notifications 248 # and a queue for server -> ui event notifications
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index 7528138740..ace1cf646b 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -186,12 +186,12 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
186 # remove this when you're done with debugging 186 # remove this when you're done with debugging
187 # allow_reuse_address = True 187 # allow_reuse_address = True
188 188
189 def __init__(self, interface): 189 def __init__(self, interface, single_use=False):
190 """ 190 """
191 Constructor 191 Constructor
192 """ 192 """
193 BaseImplServer.__init__(self) 193 BaseImplServer.__init__(self)
194 self.single_use = interface[1] == 0 # anonymous port, not getting reused 194 self.single_use = single_use
195 # Use auto port configuration 195 # Use auto port configuration
196 if (interface[1] == -1): 196 if (interface[1] == -1):
197 interface = (interface[0], 0) 197 interface = (interface[0], 0)
@@ -332,9 +332,9 @@ class BitBakeXMLRPCServerConnection(BitBakeBaseServerConnection):
332 pass 332 pass
333 333
334class BitBakeServer(BitBakeBaseServer): 334class BitBakeServer(BitBakeBaseServer):
335 def initServer(self, interface = ("localhost", 0)): 335 def initServer(self, interface = ("localhost", 0), single_use = False):
336 self.interface = interface 336 self.interface = interface
337 self.serverImpl = XMLRPCServer(interface) 337 self.serverImpl = XMLRPCServer(interface, single_use)
338 338
339 def detach(self): 339 def detach(self):
340 daemonize.createDaemon(self.serverImpl.serve_forever, "bitbake-cookerdaemon.log") 340 daemonize.createDaemon(self.serverImpl.serve_forever, "bitbake-cookerdaemon.log")