diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-08 17:17:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-08 17:34:07 +0000 |
commit | a1a86f8c311cb1fc4f5562f1c77f82aa95141eee (patch) | |
tree | 0614b164e20b07ad8663ca3460049ad0f010dd6f /lib/bb/main.py | |
parent | 6709aedccbb2e7ddbb1b2e7e4893481a7b536436 (diff) | |
download | bitbake-a1a86f8c311cb1fc4f5562f1c77f82aa95141eee.tar.gz |
main: Add timestamp to server retry messages
We have timestamps in the server logs but we don't know which
UI messages correlate to them. Add some timestamps to the messages
which doesn't make them pretty but which might make it possible to
debug problems.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/main.py')
-rwxr-xr-x | lib/bb/main.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/bb/main.py b/lib/bb/main.py index f56c3d46a..6294b85cf 100755 --- a/lib/bb/main.py +++ b/lib/bb/main.py @@ -17,6 +17,7 @@ import warnings import fcntl import time import traceback +import datetime import bb from bb import event @@ -384,6 +385,9 @@ def bitbake_main(configParams, configuration): return 1 +def timestamp(): + return datetime.datetime.now().strftime('%H:%M:%S.%f') + def setup_bitbake(configParams, extrafeatures=None): # Ensure logging messages get sent to the UI as events handler = bb.event.LogHandler() @@ -434,7 +438,7 @@ def setup_bitbake(configParams, extrafeatures=None): else: logger.info("Reconnecting to bitbake server...") if not os.path.exists(sockname): - logger.info("Previous bitbake instance shutting down?, waiting to retry...") + logger.info("Previous bitbake instance shutting down?, waiting to retry... (%s)" % timestamp()) i = 0 lock = None # Wait for 5s or until we can get the lock @@ -459,9 +463,9 @@ def setup_bitbake(configParams, extrafeatures=None): retries -= 1 tryno = 8 - retries if isinstance(e, (bb.server.process.ProcessTimeout, BrokenPipeError, EOFError, SystemExit)): - logger.info("Retrying server connection (#%d)..." % tryno) + logger.info("Retrying server connection (#%d)... (%s)" % (tryno, timestamp())) else: - logger.info("Retrying server connection (#%d)... (%s)" % (tryno, traceback.format_exc())) + logger.info("Retrying server connection (#%d)... (%s, %s)" % (tryno, traceback.format_exc(), timestamp())) if not retries: bb.fatal("Unable to connect to bitbake server, or start one (server startup failures would be in bitbake-cookerdaemon.log).") |