Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
debug: log statement_timeout + connection pid on session checkout (#9472)
Kian Jones2f0294165cfe
diff --git a/letta/server/db.py b/letta/server/db.pyindex 980e3ecd3..e7c40db3e 100644--- a/letta/server/db.py+++ b/letta/server/db.py@@ -3,7 +3,7 @@ import uuidfrom contextlib import asynccontextmanagerfrom typing import AsyncGenerator-from sqlalchemy import NullPool+from sqlalchemy import NullPool, textfrom sqlalchemy.ext.asyncio import (AsyncEngine,AsyncSession,@@ -88,6 +88,10 @@ class DatabaseRegistry:try:async with async_session_factory() as session:try:+ result = await session.execute(text("SELECT pg_backend_pid(), current_setting('statement_timeout')"))+ pid, timeout = result.one()+ logger.warning(f"[stmt_timeout_debug] pid={pid} statement_timeout={timeout}")+ await session.rollback()yield sessionawait session.commit()except asyncio.CancelledError: