Files
open-webui-custom/backend/open_webui
Classic298 d02e826c9d Fix idle in transaction leaks in Open WebUI (#20868)
* 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>
2026-02-11 18:20:03 -06:00
..
2026-02-11 16:24:11 -06:00
2026-02-11 16:24:11 -06:00
2026-02-11 16:45:47 -06:00
2026-02-11 16:24:11 -06:00
2026-02-11 18:19:01 -06:00
2026-02-11 16:24:11 -06:00
2025-08-10 00:02:58 +04:00
2026-02-11 16:24:11 -06:00
2025-12-28 23:35:09 +04:00
2026-02-11 16:24:11 -06:00
2026-02-11 18:19:01 -06:00
2026-02-11 16:24:11 -06:00
2026-02-11 16:24:11 -06:00
2026-02-11 16:24:11 -06:00
2026-02-11 16:24:11 -06:00