diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-30 22:17:23 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-31 17:05:17 +0000 |
commit | a486edbfb18cf2d3139736c7f05e4084ea98ecf0 (patch) | |
tree | d1b1b2b4b40f6c41818d7cc9848a5715a1a4a283 /bitbake/lib/bb/ui | |
parent | 4c57c6eeecc43d0479380144f3073e61a8b43375 (diff) | |
download | poky-a486edbfb18cf2d3139736c7f05e4084ea98ecf0.tar.gz |
bitbake: knotty: Ping the server/cooker periodically
We're seeing failures where the UI hangs if the server disappears. Ping
the cooker/server if we've not had any events in the last minute so we can
check if it is still alive.
(Bitbake rev: 6567ad6181f9e39812097f0154647e4b38238fdd)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 761c2dddaf..7370a1adfd 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -625,7 +625,8 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
625 | 625 | ||
626 | printintervaldelta = 10 * 60 # 10 minutes | 626 | printintervaldelta = 10 * 60 # 10 minutes |
627 | printinterval = printintervaldelta | 627 | printinterval = printintervaldelta |
628 | lastprint = time.time() | 628 | pinginterval = 1 * 60 # 1 minute |
629 | lastevent = lastprint = time.time() | ||
629 | 630 | ||
630 | termfilter = tf(main, helper, console_handlers, params.options.quiet) | 631 | termfilter = tf(main, helper, console_handlers, params.options.quiet) |
631 | atexit.register(termfilter.finish) | 632 | atexit.register(termfilter.finish) |
@@ -637,11 +638,20 @@ def main(server, eventHandler, params, tf = TerminalFilter): | |||
637 | printinterval += printintervaldelta | 638 | printinterval += printintervaldelta |
638 | event = eventHandler.waitEvent(0) | 639 | event = eventHandler.waitEvent(0) |
639 | if event is None: | 640 | if event is None: |
641 | if (lastevent + pinginterval) <= time.time(): | ||
642 | ret, error = server.runCommand(["ping"]) | ||
643 | if error or not ret: | ||
644 | termfilter.clearFooter() | ||
645 | print("No reply after pinging server (%s, %s), exiting." % (str(error), str(ret))) | ||
646 | return_value = 3 | ||
647 | main.shutdown = 2 | ||
648 | lastevent = time.time() | ||
640 | if not parseprogress: | 649 | if not parseprogress: |
641 | termfilter.updateFooter() | 650 | termfilter.updateFooter() |
642 | event = eventHandler.waitEvent(0.25) | 651 | event = eventHandler.waitEvent(0.25) |
643 | if event is None: | 652 | if event is None: |
644 | continue | 653 | continue |
654 | lastevent = time.time() | ||
645 | helper.eventHandler(event) | 655 | helper.eventHandler(event) |
646 | if isinstance(event, bb.runqueue.runQueueExitWait): | 656 | if isinstance(event, bb.runqueue.runQueueExitWait): |
647 | if not main.shutdown: | 657 | if not main.shutdown: |