discussion 2026-11-07 1866 views 33 votes

Migrating Flask blueprints to APIRouter cleanly

@tara
Platform Engineer

Hit this after a routine bump.

Symptom: Migrating Flask blueprints to APIRouter cleanly

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

@vera_rs
2026-11-07 15:16 UTC · 9 votes

paste engine kwargs and max_connections. worker×pool is the usual culprit.

@mei
2026-11-08 08:21 UTC · 5 votes

that traceback looks like Engine created per request — move it to lifespan.

@nyx_api
2026-11-08 15:25 UTC · 4 votes

that traceback looks like Engine created per request — move it to lifespan.

@yuna
2026-11-08 18:44 UTC · 6 votes

check proxy_read_timeout before blaming uvicorn resets.

@omar
2026-11-08 20:06 UTC · 8 votes

measure with keep-alive on; cold connects inflate p99.

@mira_py
2026-11-09 07:43 UTC · 4 votes

measure with keep-alive on; cold connects inflate p99.

@elias
2026-11-09 19:36 UTC · 0 votes

marking solved after we pinned the dependency and re-smoked /docs.

@piotr
2026-11-10 08:34 UTC · 0 votes

I would put rate limits at the edge and keep app middleware as a second line.

Reply

Login or register to reply.