diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-05 13:08:56 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-08-06 06:34:45 +0100 |
commit | e5782b71647d1eb6de53bde7bc4f6019a5589f21 (patch) | |
tree | 1cc582e39d58a2b95664b0bc73bdc694d5972986 /lib | |
parent | 6184cb07dfa44f5f76f1c423533b4547d80b20ab (diff) | |
download | bitbake-e5782b71647d1eb6de53bde7bc4f6019a5589f21.tar.gz |
process: Improve traceback error reporting from main loop
Currently the code can just show nothing as the exception if there was a double
fault, which in this code path is quite likely. This leads to an error log
which effectively says "it failed" with no information about how.
Improve things so we get a nice verbose traceback left in the logs/output
which is preferable to no logs.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/server/process.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index a0955722e..6127fd40e 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -26,6 +26,7 @@ import errno import re import datetime import pickle +import traceback import bb.server.xmlrpcserver from bb import daemonize from multiprocessing import queues @@ -217,8 +218,9 @@ class ProcessServer(): self.command_channel_reply.send(self.cooker.command.runCommand(command)) serverlog("Command Completed") except Exception as e: - serverlog('Exception in server main event loop running command %s (%s)' % (command, str(e))) - logger.exception('Exception in server main event loop running command %s (%s)' % (command, str(e))) + stack = traceback.format_exc() + serverlog('Exception in server main event loop running command %s (%s)' % (command, stack)) + logger.exception('Exception in server main event loop running command %s (%s)' % (command, stack)) if self.xmlrpc in ready: self.xmlrpc.handle_requests() |