Skip to content

fix(http2): cancel pipe_task and send RST_STREAM on response future drop#4042

Merged
seanmonstar merged 2 commits into
hyperium:masterfrom
mmishra100:send_explicit_reset_on_response_future_drop
Mar 31, 2026
Merged

fix(http2): cancel pipe_task and send RST_STREAM on response future drop#4042
seanmonstar merged 2 commits into
hyperium:masterfrom
mmishra100:send_explicit_reset_on_response_future_drop

Conversation

@mmishra100

Copy link
Copy Markdown
Contributor

When the client drops the response future (e.g. due to a timeout), send_task detects the cancellation but does not notify pipe_task. The pipe_task continues to hold the h2 SendStream, preventing a RST_STREAM from being sent and keeping flow-control window capacity locked.

Add a oneshot channel between send_task and pipe_task. When send_task detects cancellation via poll_canceled, it signals pipe_task through the channel. pipe_task then calls send_reset(CANCEL) on the h2 SendStream, which sends RST_STREAM to the server and frees flow-control capacity.

Closes #4040

When the client drops the response future (e.g. due to a timeout),
send_task detects the cancellation but does not notify pipe_task.
The pipe_task continues to hold the h2 SendStream, preventing a
RST_STREAM from being sent and keeping flow-control window capacity
locked.

Add a oneshot channel between send_task and pipe_task. When send_task
detects cancellation via poll_canceled, it signals pipe_task through
the channel. pipe_task then calls send_reset(CANCEL) on the h2
SendStream, which sends RST_STREAM to the server and frees
flow-control capacity.

Closes hyperium#4040
Comment thread src/proto/h2/mod.rs
Co-authored-by: Sean McArthur <sean@seanmonstar.com>

@seanmonstar seanmonstar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work tracking this down, thank you!

@seanmonstar seanmonstar merged commit 5b17a69 into hyperium:master Mar 31, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants