diff options
Diffstat (limited to 'bitbake/lib/bb/server')
-rw-r--r-- | bitbake/lib/bb/server/process.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index b66fbe0acd..4bdb84ae37 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -25,6 +25,7 @@ import subprocess | |||
25 | import errno | 25 | import errno |
26 | import re | 26 | import re |
27 | import datetime | 27 | import datetime |
28 | import gc | ||
28 | import bb.server.xmlrpcserver | 29 | import bb.server.xmlrpcserver |
29 | from bb import daemonize | 30 | from bb import daemonize |
30 | from multiprocessing import queues | 31 | from multiprocessing import queues |
@@ -152,7 +153,8 @@ class ProcessServer(multiprocessing.Process): | |||
152 | conn = newconnections.pop(-1) | 153 | conn = newconnections.pop(-1) |
153 | fds.append(conn) | 154 | fds.append(conn) |
154 | self.controllersock = conn | 155 | self.controllersock = conn |
155 | elif self.timeout is None and not ready: | 156 | |
157 | elif not self.timeout and not ready: | ||
156 | print("No timeout, exiting.") | 158 | print("No timeout, exiting.") |
157 | self.quit = True | 159 | self.quit = True |
158 | 160 | ||
@@ -220,6 +222,7 @@ class ProcessServer(multiprocessing.Process): | |||
220 | try: | 222 | try: |
221 | print("Running command %s" % command) | 223 | print("Running command %s" % command) |
222 | self.command_channel_reply.send(self.cooker.command.runCommand(command)) | 224 | self.command_channel_reply.send(self.cooker.command.runCommand(command)) |
225 | print("Command Completed") | ||
223 | except Exception as e: | 226 | except Exception as e: |
224 | logger.exception('Exception in server main event loop running command %s (%s)' % (command, str(e))) | 227 | logger.exception('Exception in server main event loop running command %s (%s)' % (command, str(e))) |
225 | 228 | ||
@@ -347,7 +350,12 @@ class ServerCommunicator(): | |||
347 | logger.info("No reply from server in 30s") | 350 | logger.info("No reply from server in 30s") |
348 | if not self.recv.poll(30): | 351 | if not self.recv.poll(30): |
349 | raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)") | 352 | raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)") |
350 | return self.recv.get() | 353 | ret, exc = self.recv.get() |
354 | # Should probably turn all exceptions in exc back into exceptions? | ||
355 | # For now, at least handle BBHandledException | ||
356 | if exc and "BBHandledException" in exc: | ||
357 | raise bb.BBHandledException() | ||
358 | return ret, exc | ||
351 | 359 | ||
352 | def updateFeatureSet(self, featureset): | 360 | def updateFeatureSet(self, featureset): |
353 | _, error = self.runCommand(["setFeatures", featureset]) | 361 | _, error = self.runCommand(["setFeatures", featureset]) |
@@ -586,7 +594,7 @@ class BBUIEventQueue: | |||
586 | self.reader = ConnectionReader(readfd) | 594 | self.reader = ConnectionReader(readfd) |
587 | 595 | ||
588 | self.t = threading.Thread() | 596 | self.t = threading.Thread() |
589 | self.t.setDaemon(True) | 597 | self.t.daemon = True |
590 | self.t.run = self.startCallbackHandler | 598 | self.t.run = self.startCallbackHandler |
591 | self.t.start() | 599 | self.t.start() |
592 | 600 | ||
@@ -664,8 +672,10 @@ class ConnectionWriter(object): | |||
664 | 672 | ||
665 | def send(self, obj): | 673 | def send(self, obj): |
666 | obj = multiprocessing.reduction.ForkingPickler.dumps(obj) | 674 | obj = multiprocessing.reduction.ForkingPickler.dumps(obj) |
675 | gc.disable() | ||
667 | with self.wlock: | 676 | with self.wlock: |
668 | self.writer.send_bytes(obj) | 677 | self.writer.send_bytes(obj) |
678 | gc.enable() | ||
669 | 679 | ||
670 | def fileno(self): | 680 | def fileno(self): |
671 | return self.writer.fileno() | 681 | return self.writer.fileno() |