Дело не в нагрузке: почему пул httpx теряет соединения при отменах

habrahabr.ru · world
Full story

A technical article examines why httpx connection pools lose connections during cancellations. It describes PoolTimeout occurring even when free connections appear to be available, and busy counts rising slowly despite steady RPS. The suspected cause is not load but cancellation when a response is closed: in httpcore the connection remains in ACTIVE state and no one is left to close it again. The article covers pool-state diagnostics, a minimal reproduction and possible fixes, noting there is no upstream fix yet.

PoolTimeout, когда свободные соединения вроде бы есть, и медленный рост busy при ровном RPS — знакомые симптомы? Причина может быть не в нагрузке, а в отмене запроса при закрытии ответа: в httpcore соединение остаётся в состоянии ACTIVE, а закрыть его повторно уже некому. В статье — диагностика по состоянию пула, минимальное воспроизведение и варианты исправления, пока фикса в upstream нет. Читать далее

Read full article → Compare