discussion 2026-10-20 139 views 1 votes

httpx.AsyncClient lifespan: close in shutdown?

@seth
SRE

Hit this after a routine bump.

Symptom: httpx.AsyncClient lifespan: close in shutdown?

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

@nox
2026-10-20 13:22 UTC · 6 votes

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

@nox
2026-10-20 16:56 UTC · 4 votes

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

@sana
2026-10-20 17:30 UTC · 7 votes

minimal repro with ASGITransport would help more than screenshots.

@cleo_dev29
2026-10-21 10:20 UTC · 0 votes

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

@cole
2026-10-21 17:19 UTC · 9 votes

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

@nik
2026-10-22 05:36 UTC · 7 votes

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

@elias
2026-10-22 19:07 UTC · 0 votes

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

@leo_cache
2026-10-23 08:01 UTC · 4 votes

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

Reply

Login or register to reply.