From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: [PATCH] server/process: Use the setFeatures command on the server instead of a manger
Date: Sun, 09 Mar 2014 10:02:50 -0700 [thread overview]
Message-ID: <1394384570.7883.10.camel@ted> (raw)
The use of a manager in the process server causes some issues since it remains
around for the lifetime of the server even though its only used during
initialisation and the system doesn't respond well to SIGTERM events
to the extra process (and two threads) the implementation involves.
Switching to a dedicated command simplifies the server process structure.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index aa07202..6db6a23 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -80,7 +80,7 @@ class ProcessServer(Process, BaseImplServer):
def __init__(self, command_channel, event_queue, featurelist):
BaseImplServer.__init__(self)
- Process.__init__(self, args=(featurelist))
+ Process.__init__(self)
self.command_channel = command_channel
self.event_queue = event_queue
self.event = EventAdapter(event_queue)
@@ -96,13 +96,6 @@ class ProcessServer(Process, BaseImplServer):
self.event_queue.put(event)
self.event_handle.value = bb.event.register_UIHhandler(self)
- # process any feature changes based on what UI requested
- original_featureset = list(self.cooker.featureset)
- while len(self.featurelist)> 0:
- self.cooker.featureset.setFeature(self.featurelist.pop())
- if (original_featureset != list(self.cooker.featureset)):
- self.cooker.reset()
-
bb.cooker.server_main(self.cooker, self.main)
def main(self):
@@ -207,17 +200,19 @@ class BitBakeServer(BitBakeBaseServer):
#
self.ui_channel, self.server_channel = Pipe()
self.event_queue = ProcessEventQueue(0)
- manager = Manager()
- self.featurelist = manager.list()
- self.serverImpl = ProcessServer(self.server_channel, self.event_queue, self.featurelist)
+ self.serverImpl = ProcessServer(self.server_channel, self.event_queue, None)
def detach(self):
self.serverImpl.start()
return
def establishConnection(self, featureset):
- for f in featureset:
- self.featurelist.append(f)
+
self.connection = BitBakeProcessServerConnection(self.serverImpl, self.ui_channel, self.event_queue)
+
+ _, error = self.connection.connection.runCommand(["setFeatures", featureset])
+ if error:
+ logger.error("Unable to set the cooker to the correct featureset: %s" % error)
+ raise BaseException(error)
signal.signal(signal.SIGTERM, lambda i, s: self.connection.terminate())
return self.connection
reply other threads:[~2014-03-09 17:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394384570.7883.10.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.