Hyper's header_read_timeout closes idle keep-alive connections, causing client errors
A developer load-testing a payment sandbox with k6 found that Rust's hyper HTTP engine, used under Axum, was dropping healthy idle keep-alive connections. The header_read_timeout starts its clock before a request's first byte arrives and keeps running between requests on HTTP/1.1 connections. When it expires, hyper closes the socket without a response, so clients reusing pooled connections saw EOF errors and status 0. Removing the timeout call does not disable it, since hyper falls back to a 30-second default once a timer is configured. The recommended fix is to keep the client or proxy idle timeout below the server's bound, set header_read_timeout explicitly, and add a regression test for the idle boundary.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in