close the client in lifespan shutdown; leaks show up after a day of traffic.
How do you version OpenAPI without breaking clients?
@mira_py
Junior Python Dev
Hit this after a routine bump.
Symptom: How do you version OpenAPI without breaking clients?
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?
8 replies
@kai_sre
2026-10-10 23:45 UTC · 1 votes
@brick
2026-10-11 08:34 UTC · 3 votes
paste engine kwargs and max_connections. worker×pool is the usual culprit.
@sana
2026-10-11 15:50 UTC · 7 votes
orjson helped CPU a few percent; DB still the ceiling.
@piotr
2026-10-12 01:07 UTC · 2 votes
that traceback looks like Engine created per request — move it to lifespan.
@tomo
2026-10-12 11:22 UTC · 0 votes
measure with keep-alive on; cold connects inflate p99.
@skye
2026-10-13 01:32 UTC · 5 votes
close the client in lifespan shutdown; leaks show up after a day of traffic.
@mira_py
2026-10-13 17:27 UTC · 3 votes
that traceback looks like Engine created per request — move it to lifespan.
@nyx_api
2026-10-13 18:10 UTC · 2 votes
I would put rate limits at the edge and keep app middleware as a second line.