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-09 13:22:11 +0000 |
commit | 8aa083f842cc54fb7c0ef3ff8724fed2dff40d66 (patch) | |
tree | 845a0c843699ffdb0100e84852c9fafbee1bcbd9 /bitbake | |
parent | cc63d80b9433e2eec2c9e33808e676956d6906ba (diff) | |
download | poky-8aa083f842cc54fb7c0ef3ff8724fed2dff40d66.tar.gz |
bitbake: 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.
(Bitbake rev: a1a86f8c311cb1fc4f5562f1c77f82aa95141eee)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/lib/bb/main.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index f56c3d46a2..6294b85cfd 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
@@ -17,6 +17,7 @@ import warnings | |||
17 | import fcntl | 17 | import fcntl |
18 | import time | 18 | import time |
19 | import traceback | 19 | import traceback |
20 | import datetime | ||
20 | 21 | ||
21 | import bb | 22 | import bb |
22 | from bb import event | 23 | from bb import event |
@@ -384,6 +385,9 @@ def bitbake_main(configParams, configuration): | |||
384 | 385 | ||
385 | return 1 | 386 | return 1 |
386 | 387 | ||
388 | def timestamp(): | ||
389 | return datetime.datetime.now().strftime('%H:%M:%S.%f') | ||
390 | |||
387 | def setup_bitbake(configParams, extrafeatures=None): | 391 | def setup_bitbake(configParams, extrafeatures=None): |
388 | # Ensure logging messages get sent to the UI as events | 392 | # Ensure logging messages get sent to the UI as events |
389 | handler = bb.event.LogHandler() | 393 | handler = bb.event.LogHandler() |
@@ -434,7 +438,7 @@ def setup_bitbake(configParams, extrafeatures=None): | |||
434 | else: | 438 | else: |
435 | logger.info("Reconnecting to bitbake server...") | 439 | logger.info("Reconnecting to bitbake server...") |
436 | if not os.path.exists(sockname): | 440 | if not os.path.exists(sockname): |
437 | logger.info("Previous bitbake instance shutting down?, waiting to retry...") | 441 | logger.info("Previous bitbake instance shutting down?, waiting to retry... (%s)" % timestamp()) |
438 | i = 0 | 442 | i = 0 |
439 | lock = None | 443 | lock = None |
440 | # Wait for 5s or until we can get the lock | 444 | # Wait for 5s or until we can get the lock |
@@ -459,9 +463,9 @@ def setup_bitbake(configParams, extrafeatures=None): | |||
459 | retries -= 1 | 463 | retries -= 1 |
460 | tryno = 8 - retries | 464 | tryno = 8 - retries |
461 | if isinstance(e, (bb.server.process.ProcessTimeout, BrokenPipeError, EOFError, SystemExit)): | 465 | if isinstance(e, (bb.server.process.ProcessTimeout, BrokenPipeError, EOFError, SystemExit)): |
462 | logger.info("Retrying server connection (#%d)..." % tryno) | 466 | logger.info("Retrying server connection (#%d)... (%s)" % (tryno, timestamp())) |
463 | else: | 467 | else: |
464 | logger.info("Retrying server connection (#%d)... (%s)" % (tryno, traceback.format_exc())) | 468 | logger.info("Retrying server connection (#%d)... (%s, %s)" % (tryno, traceback.format_exc(), timestamp())) |
465 | 469 | ||
466 | if not retries: | 470 | if not retries: |
467 | bb.fatal("Unable to connect to bitbake server, or start one (server startup failures would be in bitbake-cookerdaemon.log).") | 471 | bb.fatal("Unable to connect to bitbake server, or start one (server startup failures would be in bitbake-cookerdaemon.log).") |