Skip to content

Apply recv_timeout to HTTP/3 requests - #1033

Merged
benoitc merged 1 commit into
masterfrom
fix/h3-recv-timeout
Nov 15, 2026
Merged

benoitc merged 1 commit into
masterfrom
fix/h3-recv-timeout

Conversation

@benoitc

@benoitc benoitc commented Nov 14, 2026

Copy link
Copy Markdown
Owner

A sync HTTP/3 request had no timeout on its response. The caller waits with infinity and nothing in hackney_conn bounded the stream, so a server that stopped sending, before the headers or mid-body, blocked the request forever. The body size is already capped by max_body_size; only the time was unbounded.

Sync HTTP/3 streams now get the same per-stream recv_timeout watchdog as HTTP/2. It restarts on each headers or data event, so the deadline counts from the last byte received. When it fires the stream is reset with H3_REQUEST_CANCELLED and the request fails with {error, timeout}; the connection stays usable.

A sync HTTP/3 request waited for its response with no timeout: a
server that stopped sending, before the headers or in the middle of
the body, blocked the caller forever. Each such stream now has a
recv_timeout watchdog, restarted on every headers or data event, as
HTTP/2 has. When it fires the stream is reset and the request fails
with {error, timeout}.
@benoitc
benoitc merged commit 68aeaf0 into master Nov 15, 2026
6 checks passed
@benoitc
benoitc deleted the fix/h3-recv-timeout branch November 15, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant