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

Add a new handler to close on inbound http/2 protocol errors #1701

Merged
merged 7 commits into from Nov 15, 2023

Conversation

jguerra
Copy link
Contributor

@jguerra jguerra commented Nov 15, 2023

Handles closing the connection logging/counting malformed requests like invalid hpack, or invalid stream numbers.


@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
if(cause instanceof Http2Exception http2Exception && http2Exception.shutdownHint() == Http2Exception.ShutdownHint.HARD_SHUTDOWN) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The Http2ConnectionHandler has a generic mechanism to send GO_AWAY frames and close on connection errors.
Is that not kicking in here or are we trying to address specific cases that aren't flagged via that mechanism?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I missed that subtlety. Http2FrameCodec calls fireExceptionCaught (what this PR is intended to address) and then after that Http2ConnectionHandler.onConnectionError. I'll rework this PR to just capture metrics

@jguerra jguerra merged commit 1f4042a into master Nov 15, 2023
5 checks passed
@jguerra jguerra deleted the jg/h2_errors branch February 29, 2024 20:38
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.

None yet

2 participants