mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-28 16:11:43 -05:00
* fix: add ScopedSession.remove() to prevent idle transaction leaks The HTTP middleware was calling ScopedSession.commit() but not ScopedSession.remove(), causing database connections to remain "checked out" from the pool indefinitely. This resulted in "idle in transaction" connections in PostgreSQL that could persist for 30-50+ minutes. With SQLAlchemy's scoped_session: - commit() commits but keeps the session active - remove() is required to return the connection to the pool This fix adds the missing remove() call, ensuring connections are properly returned after each HTTP request. Also includes IDLE_TRANSACTION_ANALYSIS.md documenting the full root cause analysis and additional recommendations. * Delete IDLE_TRANSACTION_ANALYSIS.md --------- Co-authored-by: Claude <noreply@anthropic.com>