Skip to content

Handle HTTP/2 half-closed connections gracefully. #777

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

karpetrosyan
Copy link
Member

@karpetrosyan karpetrosyan commented Aug 9, 2023

Closes #775

TODO:

  • Add failing tests
  • Suppress exceptions while sending the request
  • Add changelog

Comment on lines +159 to +180
hyperframe.frame.WindowUpdateFrame(
stream_id=0, window_increment=2147418112
).serialize()
+ hyperframe.frame.WindowUpdateFrame(
stream_id=1, window_increment=2147418112
).serialize()
+ hyperframe.frame.HeadersFrame(
stream_id=1,
data=hpack.Encoder().encode(
[
(b":status", b"413"),
(b"content-type", b"plain/text"),
]
),
flags=["END_HEADERS"],
).serialize()
+ hyperframe.frame.DataFrame(
stream_id=1,
data=b"Request body exceeded 1,000,000 bytes",
flags=["END_STREAM"],
).serialize()
+ hyperframe.frame.RstStreamFrame(stream_id=1, error_code=0).serialize(),
Copy link
Member

Choose a reason for hiding this comment

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

Interesting. Is it intentional/neccessary-for-the-test that the data for these frames is concatenated?

Copy link
Member Author

Choose a reason for hiding this comment

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

I ran into some issues without frame concatenation.

Copy link
Member Author

@karpetrosyan karpetrosyan Sep 1, 2023

Choose a reason for hiding this comment

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

Without cancatenation, the client has enough time to send the entire request and receives 413 with no stream errors.

Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle HTTP/2 half-closed connections gracefully
2 participants