Engineering posts
Cloudflare traces an intermittent image-truncation bug to a discarded Poll::Pending in hyper
- Category: Engineering post
- Status: confirmed
- Sources: Cloudflare blog, discussion
- Summary: Cloudflare published a 2026-06-22 write-up of a six-week hunt for a bug in its Rust-based Images service, where larger transformed images intermittently returned a 200 status with the body cut short (a 2 MB response arriving as a few hundred kilobytes). The root cause was in hyper's HTTP/1 connection state machine in
dispatch.rs: alet _ =beforepoll_flushdiscarded the result, including thePoll::Pendingthat signals an incomplete flush, so the write loop never learned that megabytes were still buffered. The fix was four lines. - Why it matters: It is a concrete example of how silently dropping a
Poll::Pendingin async Rust produces a data-truncation race that surfaces only under load and large payloads, a failure mode for any service building on hyper or hand-written poll loops.