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

Is it possible to send a ping frame over HTTP/2 using Armeria? #5553

Open
kth496 opened this issue Apr 2, 2024 · 5 comments
Open

Is it possible to send a ping frame over HTTP/2 using Armeria? #5553

kth496 opened this issue Apr 2, 2024 · 5 comments
Labels

Comments

@kth496
Copy link
Contributor

kth496 commented Apr 2, 2024

In other frameworks such as Vert.x, users can send an arbitrary ping frame using its HTTP connection instance (docs)

I discovered a related PR (#2409) that introduces a feature enabling Armeria to send an HTTP/2 ping frame on an idle connection. However, this functionality was specifically implemented using Netty's ChannelHandlerContext and is exclusively available for Http2KeepAliveHandler. Given this context, how can I send a ping frame after establishing an HTTP/2 connection?

@trustin
Copy link
Member

trustin commented Apr 2, 2024

At the moment, there's no simple way to send an HTTP/2 ping frame in Armeria. Although I didn't try by myself, you may be able to do so by customizing Armeria's Netty ChannelPipeline using ServerBuilder.childChannelPipelineCustomizer() (Javadoc).

What's the use case for sending HTTP/2 pings by yourself rather than letting the framework send them to keep the connection alive?

@kth496
Copy link
Contributor Author

kth496 commented Apr 2, 2024

@trustin
First of all, I apologize for not being able to provide a detailed use case due to work commitments.

The nature of my environment makes it unimportant whether I set the Connection: Keep-Alive header or not. Because connections can be dropped frequently, so there is a use case where I want to actively check for connections on the server side. As mentioned in the http2 specification about PING frame, I would like to use ping frames for minimal connection liveness checking and round trip time measurement.

If any further clarification is needed, please feel free to ask. Thank you.

@trustin
Copy link
Member

trustin commented Apr 2, 2024

If your goal is to detect an unexpected disconnection and clean it up quickly, would resolving this issue solve your problem?

@kth496
Copy link
Contributor Author

kth496 commented Apr 3, 2024

Thank you @trustin, I'll take a look at the linked issue!

@ikhoon
Copy link
Contributor

ikhoon commented Apr 5, 2024

Because connections can be dropped frequently, so there is a use case where I want to actively check for connections on the server side.

Q1) Does your server forcibly close an HTTP/2 connection without sending a GOAWAY frame?

Q2) Couldn't our current implementation of HTTP/2 ping-sending logic detect your network disruptions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants