summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bb/server/process.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 3e99bcef8..155e8d131 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -367,7 +367,12 @@ class ProcessServer():
self.next_heartbeat = now + self.heartbeat_seconds
if hasattr(self.cooker, "data"):
heartbeat = bb.event.HeartbeatEvent(now)
- bb.event.fire(heartbeat, self.cooker.data)
+ try:
+ bb.event.fire(heartbeat, self.cooker.data)
+ except Exception as exc:
+ if not isinstance(exc, bb.BBHandledException):
+ logger.exception('Running heartbeat function')
+ self.quit = True
if nextsleep and now + nextsleep > self.next_heartbeat:
# Shorten timeout so that we we wake up in time for
# the heartbeat.