diff options
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r-- | bitbake/lib/bb/server/process.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index f62faed000..40cb99bc97 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -38,8 +38,11 @@ logger = logging.getLogger('BitBake') | |||
38 | class ProcessTimeout(SystemExit): | 38 | class ProcessTimeout(SystemExit): |
39 | pass | 39 | pass |
40 | 40 | ||
41 | def currenttime(): | ||
42 | return datetime.datetime.now().strftime('%H:%M:%S.%f') | ||
43 | |||
41 | def serverlog(msg): | 44 | def serverlog(msg): |
42 | print(str(os.getpid()) + " " + datetime.datetime.now().strftime('%H:%M:%S.%f') + " " + msg) | 45 | print(str(os.getpid()) + " " + currenttime() + " " + msg) |
43 | sys.stdout.flush() | 46 | sys.stdout.flush() |
44 | 47 | ||
45 | # | 48 | # |
@@ -289,7 +292,9 @@ class ProcessServer(): | |||
289 | continue | 292 | continue |
290 | try: | 293 | try: |
291 | serverlog("Running command %s" % command) | 294 | serverlog("Running command %s" % command) |
292 | self.command_channel_reply.send(self.cooker.command.runCommand(command, self)) | 295 | reply = self.cooker.command.runCommand(command, self) |
296 | serverlog("Sending reply %s" % repr(reply)) | ||
297 | self.command_channel_reply.send(reply) | ||
293 | serverlog("Command Completed (socket: %s)" % os.path.exists(self.sockname)) | 298 | serverlog("Command Completed (socket: %s)" % os.path.exists(self.sockname)) |
294 | except Exception as e: | 299 | except Exception as e: |
295 | stack = traceback.format_exc() | 300 | stack = traceback.format_exc() |
@@ -502,9 +507,9 @@ class ServerCommunicator(): | |||
502 | def runCommand(self, command): | 507 | def runCommand(self, command): |
503 | self.connection.send(command) | 508 | self.connection.send(command) |
504 | if not self.recv.poll(30): | 509 | if not self.recv.poll(30): |
505 | logger.info("No reply from server in 30s (for command %s)" % command[0]) | 510 | logger.info("No reply from server in 30s (for command %s at %s)" % (command[0], currenttime())) |
506 | if not self.recv.poll(30): | 511 | if not self.recv.poll(30): |
507 | raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)") | 512 | raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s at %s)" % currenttime()) |
508 | ret, exc = self.recv.get() | 513 | ret, exc = self.recv.get() |
509 | # Should probably turn all exceptions in exc back into exceptions? | 514 | # Should probably turn all exceptions in exc back into exceptions? |
510 | # For now, at least handle BBHandledException | 515 | # For now, at least handle BBHandledException |