Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
feat: dump thread state on event loop hang (#8388)
cthomas1d360cc2392a
diff --git a/letta/monitoring/event_loop_watchdog.py b/letta/monitoring/event_loop_watchdog.pyindex 2d707753e..ac8bd015b 100644--- a/letta/monitoring/event_loop_watchdog.py+++ b/letta/monitoring/event_loop_watchdog.py@@ -139,7 +139,8 @@ class EventLoopWatchdog:# Only dump stack traces with 60s cooldown to avoid spamif (now - self._last_dump_time) > 60.0:- self._dump_asyncio_tasks()+ self._dump_asyncio_tasks() # Dump async tasks+ self._dump_state() # Dump thread stacksself._last_dump_time = nowelse:# Reset saturation tracking when recovered@@ -156,8 +157,8 @@ class EventLoopWatchdog:)# Dump both thread state and asyncio tasks- self._dump_state()self._dump_asyncio_tasks()+ self._dump_state()if consecutive_hangs >= 2:logger.critical(f"Event loop appears frozen ({consecutive_hangs} consecutive hangs), tasks={task_count}")