discussion 2026-09-29 672 views 40 votes

httpx.AsyncClient lifespan: close in shutdown? — follow-up #3

@leo_cache
Backend Engineer

Hit this after a routine bump.

Symptom: httpx.AsyncClient lifespan: close in shutdown? — follow-up #3

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?

6 replies

@piotr
2026-09-29 18:40 UTC · 0 votes

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

@kai_sre
2026-09-30 10:17 UTC · 3 votes

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

@nik
2026-09-30 11:59 UTC · 9 votes

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

@nox
2026-10-01 03:38 UTC · 10 votes

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

@omar
2026-10-01 06:29 UTC · 5 votes

check proxy_read_timeout before blaming uvicorn resets.

@eng_1014_22
2026-11-23 02:59 UTC · 2 votes

align client timeout below proxy timeout or you get retry storms.

Reply

Login or register to reply.