@yuna
2026-10-23 21:39 UTC · 5 votes
paste engine kwargs and max_connections. worker×pool is the usual culprit.
Hit this after a routine bump.
Symptom: Cancel asyncio tasks when client disconnects
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?
paste engine kwargs and max_connections. worker×pool is the usual culprit.
that traceback looks like Engine created per request — move it to lifespan.
check proxy_read_timeout before blaming uvicorn resets.
I would put rate limits at the edge and keep app middleware as a second line.
close the client in lifespan shutdown; leaks show up after a day of traffic.
check proxy_read_timeout before blaming uvicorn resets.
paste engine kwargs and max_connections. worker×pool is the usual culprit.
dropping pool_size per worker fixed it for us on the same box size.