@rine
2026-10-18 00:15 UTC · 0 votes
that traceback looks like Engine created per request — move it to lifespan.
Hit this after a routine bump.
Symptom: Deadlocks with nested begin() in SQLAlchemy 2
TimeoutError / pool exhausted / upstream reset
(versions in next reply if needed)
Env: Python 3.12, FastAPI recent, uvicorn workers≥2.
What should I check first?
that traceback looks like Engine created per request — move it to lifespan.
minimal repro with ASGITransport would help more than screenshots.
marking solved after we pinned the dependency and re-smoked /docs.
dropping pool_size per worker fixed it for us on the same box size.
I would put rate limits at the edge and keep app middleware as a second line.