diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-09 10:02:50 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-10 11:09:59 -0700 |
commit | 8fbe21845c67a81e79039268717941312fbc7d30 (patch) | |
tree | b1272aed95a4ba0430e52f010ac21bf9251b2e20 /bitbake/lib/bb/server/process.py | |
parent | d51bf8d9f6d34542879d286e127dbeb4d3bd6253 (diff) | |
download | poky-8fbe21845c67a81e79039268717941312fbc7d30.tar.gz |
bitbake: server/process: Use the setFeatures command on the server instead of a manger
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.
(Bitbake rev: 74532a7cf8ccea8b85f1cda5d5bc23d2f3c72a08)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r-- | bitbake/lib/bb/server/process.py | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index aa072020af..6db6a2326d 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -80,7 +80,7 @@ class ProcessServer(Process, BaseImplServer): | |||
80 | 80 | ||
81 | def __init__(self, command_channel, event_queue, featurelist): | 81 | def __init__(self, command_channel, event_queue, featurelist): |
82 | BaseImplServer.__init__(self) | 82 | BaseImplServer.__init__(self) |
83 | Process.__init__(self, args=(featurelist)) | 83 | Process.__init__(self) |
84 | self.command_channel = command_channel | 84 | self.command_channel = command_channel |
85 | self.event_queue = event_queue | 85 | self.event_queue = event_queue |
86 | self.event = EventAdapter(event_queue) | 86 | self.event = EventAdapter(event_queue) |
@@ -96,13 +96,6 @@ class ProcessServer(Process, BaseImplServer): | |||
96 | self.event_queue.put(event) | 96 | self.event_queue.put(event) |
97 | self.event_handle.value = bb.event.register_UIHhandler(self) | 97 | self.event_handle.value = bb.event.register_UIHhandler(self) |
98 | 98 | ||
99 | # process any feature changes based on what UI requested | ||
100 | original_featureset = list(self.cooker.featureset) | ||
101 | while len(self.featurelist)> 0: | ||
102 | self.cooker.featureset.setFeature(self.featurelist.pop()) | ||
103 | if (original_featureset != list(self.cooker.featureset)): | ||
104 | self.cooker.reset() | ||
105 | |||
106 | bb.cooker.server_main(self.cooker, self.main) | 99 | bb.cooker.server_main(self.cooker, self.main) |
107 | 100 | ||
108 | def main(self): | 101 | def main(self): |
@@ -207,17 +200,19 @@ class BitBakeServer(BitBakeBaseServer): | |||
207 | # | 200 | # |
208 | self.ui_channel, self.server_channel = Pipe() | 201 | self.ui_channel, self.server_channel = Pipe() |
209 | self.event_queue = ProcessEventQueue(0) | 202 | self.event_queue = ProcessEventQueue(0) |
210 | manager = Manager() | 203 | self.serverImpl = ProcessServer(self.server_channel, self.event_queue, None) |
211 | self.featurelist = manager.list() | ||
212 | self.serverImpl = ProcessServer(self.server_channel, self.event_queue, self.featurelist) | ||
213 | 204 | ||
214 | def detach(self): | 205 | def detach(self): |
215 | self.serverImpl.start() | 206 | self.serverImpl.start() |
216 | return | 207 | return |
217 | 208 | ||
218 | def establishConnection(self, featureset): | 209 | def establishConnection(self, featureset): |
219 | for f in featureset: | 210 | |
220 | self.featurelist.append(f) | ||
221 | self.connection = BitBakeProcessServerConnection(self.serverImpl, self.ui_channel, self.event_queue) | 211 | self.connection = BitBakeProcessServerConnection(self.serverImpl, self.ui_channel, self.event_queue) |
212 | |||
213 | _, error = self.connection.connection.runCommand(["setFeatures", featureset]) | ||
214 | if error: | ||
215 | logger.error("Unable to set the cooker to the correct featureset: %s" % error) | ||
216 | raise BaseException(error) | ||
222 | signal.signal(signal.SIGTERM, lambda i, s: self.connection.terminate()) | 217 | signal.signal(signal.SIGTERM, lambda i, s: self.connection.terminate()) |
223 | return self.connection | 218 | return self.connection |