Skip to content

Commit 9c11d44

Browse files
committed
contest-hw: mctrl: catch errors in health checking
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 2a7f159 commit 9c11d44

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

contest/hw/lib/health.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,14 @@ def check_machine(self, machine_id, machine):
102102

103103
def run(self):
104104
while not self._stop_event.is_set():
105-
for machine_id, machine in self.machines.items():
106-
if self._stop_event.is_set():
107-
break
108-
self.check_machine(machine_id, machine)
105+
try:
106+
for machine_id, machine in self.machines.items():
107+
if self._stop_event.is_set():
108+
break
109+
try:
110+
self.check_machine(machine_id, machine)
111+
except Exception as e:
112+
print(f"Health: error checking {machine.get('name', machine_id)}: {e}")
113+
except Exception as e:
114+
print(f"Health: error in check round: {e}")
109115
self._stop_event.wait(self.interval)

0 commit comments

Comments
 (0)