solved 2026-11-16 1287 views 25 votes

asyncio.Lock around cold cache fill

@seth
SRE

Hit this after a routine bump.

Symptom: asyncio.Lock around cold cache fill

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?

5 replies

@oz
2026-11-17 03:52 UTC · 5 votes

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

@vera_rs
2026-11-17 14:43 UTC · 9 votes

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

@vera_rs
2026-11-17 22:05 UTC · 4 votes

dropping pool_size per worker fixed it for us on the same box size.

@amira
2026-11-18 17:24 UTC · 0 votes

check proxy_read_timeout before blaming uvicorn resets.

@skye
2026-11-18 18:30 UTC · 6 votes

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

Reply

Login or register to reply.