Rocket 0.5.4
Rocket 0.5.4 was released on November 19, 2026, and the stable Rust web framework now drops a response body as soon as the client disconnects, closing a resource leak that could keep stalled streams alive until the server shut down.
What Changed
The patch, tracked as issue #3022 and merged through PR #3023, alters when Rocket notices that nobody is listening. Before this release, the framework only learned about a disconnected client the next time it tried to write the following part of a body. A body that never produced more data, for example a stream waiting on a slow upstream source, was never polled for that signal. It stayed in memory and kept being retained until the process ended.
Rocket now stops reading and drops the body when an HTTP/1.1 connection closes or an HTTP/2 stream is reset. Detection is tied to the connection state itself rather than to the next successful write, so idle or stalled producers are cleaned up on the same event that tells the framework the client is gone.
Why It Matters
Long-lived response bodies are common: server-sent events, chunked downloads, proxied streams and websocket-adjacent patterns all depend on a producer that may pause. In those designs a client that vanishes during a quiet period is the normal case, not the edge case. Retaining such a body holds its buffers, its file handles and whatever upstream connection it wraps, which turns a routine browser tab close into pressure on memory and file descriptors. On a busy endpoint the leak compounds quietly, and the symptom is usually a server that looks healthy until it runs out of descriptors.
Context in the 0.5 Line
This release follows 0.5.3, published the day before, which dealt with the mirror image of the problem. That version made connections linger for up to ten seconds after the last response so unread upload data would not trigger a TCP reset, and it aborted responses whose bodies failed mid-read. Taken together, the two patches harden the boundary between Rocket and a client that leaves early or sends malformed traffic.
0.5.4 contains no API changes, no new configuration keys and no dependency bumps. It is a one-fix release confined to the core rocket crate, so a version bump in Cargo.toml is the whole upgrade.
How to Upgrade
Run cargo update -p rocket and rebuild. Projects that pin an exact version need the requirement edited to 0.5.4. Because the change only affects cleanup timing, throughput benchmarks should be unchanged; the measurable difference appears in resident memory and open descriptors on endpoints that stream to clients which disconnect early.