diff mbox series

[09/10] server/process: Improve exception logging

Message ID 20221222234726.579702-9-richard.purdie@linuxfoundation.org
State New
Headers show
Series [01/10] knotty: Ping the server/cooker periodically | expand

Commit Message

Richard Purdie Dec. 22, 2022, 11:47 p.m. UTC
Currently if either idle functions loop suffers a traceback, it is
silently dropped and there is no log message to say what happened.
This change at least means the traceback is in the cooker log, making
some debugging possible.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/server/process.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 63d37ae0d5..49cca8d23d 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -389,6 +389,7 @@  class ProcessServer():
                     if not isinstance(exc, bb.BBHandledException):
                         logger.exception('Running idle function')
                     del self._idlefuns[function]
+                    serverlog("Exception %s broke the idle_thread, exiting" % traceback.format_exc())
                     self.quit = True
 
             # FIXME - the 1 is the inotify processing in cooker which always runs
@@ -422,6 +423,7 @@  class ProcessServer():
                 except Exception as exc:
                     if not isinstance(exc, bb.BBHandledException):
                         logger.exception('Running heartbeat function')
+                    serverlog("Exception %s broke in idle_commands, exiting" % traceback.format_exc())
                     self.quit = True
         if nextsleep and bb.event._heartbeat_enabled and now + nextsleep > self.next_heartbeat:
             # Shorten timeout so that we we wake up in time for