Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP2 should cancel quickly if stream is reset #1549

Closed
seanmonstar opened this issue Jun 6, 2018 · 2 comments
Closed

HTTP2 should cancel quickly if stream is reset #1549

seanmonstar opened this issue Jun 6, 2018 · 2 comments
Labels
A-http2 Area: HTTP/2 specific. C-feature Category: feature. This is adding a new feature. E-easy Effort: easy. A task that would be a great starting point for a new contributor.

Comments

@seanmonstar
Copy link
Member

When sending a body over HTTP2, if it takes a while to generate another chunk (so, Payload::poll_data returned NotReady), and the remote sends a RST_STREAM, the body should be canceled at that moment. Currently, hyper won't notice the RST_STREAM until once Payload::poll_data notifies the task that a new chunk is ready, and then hyper tries to write it via send_data.

In a similar vein, in the server, if a Future for a Response takes a while, we should also be sure to cancel that Future immediately if the client sends a RST_STREAM for it.

Steps to fix

  • Essentially, the fix is applying what was done in tower-h2, in this commit.
@seanmonstar seanmonstar added E-easy Effort: easy. A task that would be a great starting point for a new contributor. C-feature Category: feature. This is adding a new feature. A-http2 Area: HTTP/2 specific. labels Jun 6, 2018
@joshleeb
Copy link

joshleeb commented Jun 8, 2018

I'd like to take this one on 😄

@joshleeb
Copy link

joshleeb commented Jun 20, 2018

@seanmonstar apologies for taking so long to get to this.

I've used the tower-h2 code as a guide but I'm not sure if I'm on the right track.

seanmonstar pushed a commit that referenced this issue Jun 25, 2018
Update Http2 proto to cancel quick when the stream is reset, on an
`RST_STREAM` frame.

Closes: #1549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-http2 Area: HTTP/2 specific. C-feature Category: feature. This is adding a new feature. E-easy Effort: easy. A task that would be a great starting point for a new contributor.
Projects
None yet
Development

No branches or pull requests

2 participants