1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

bitbake: tinfoil: Don't wait for events indefinitely

If for some reason the bitbake server dies, we shouldn't loop indefinitely
waiting for events within tinfoil. Add a ping test and exit if things
have somehow failed.

(Bitbake rev: 32da768ae67cfe0b2d154ce4667a7cfdfa5bf4b0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2023-01-11 14:31:01 +00:00
parent 3d67b6c60f
commit 92c0dba456
+7 -1
View File
@@ -10,6 +10,7 @@
import logging
import os
import sys
import time
import atexit
import re
from collections import OrderedDict, defaultdict
@@ -729,6 +730,7 @@ class Tinfoil:
ret = self.run_command('buildTargets', targets, task)
if handle_events:
lastevent = time.time()
result = False
# Borrowed from knotty, instead somewhat hackily we use the helper
# as the object to store "shutdown" on
@@ -741,6 +743,7 @@ class Tinfoil:
try:
event = self.wait_event(0.25)
if event:
lastevent = time.time()
if event_callback and event_callback(event):
continue
if helper.eventHandler(event):
@@ -785,10 +788,13 @@ class Tinfoil:
self.logger.error(str(event))
result = False
break
elif helper.shutdown > 1:
break
termfilter.updateFooter()
if time.time() > (lastevent + (3*60)):
if not self.run_command('ping', handle_events=False):
print("\nUnable to ping server and no events, closing down...\n")
return False
except KeyboardInterrupt:
termfilter.clearFooter()
if helper.shutdown == 1: