-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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 HTTP/2 keep alive pings #22565
Add HTTP/2 keep alive pings #22565
Conversation
src/Servers/Kestrel/Core/src/Internal/Http2/Http2ConnectionKeepAlive.cs
Outdated
Show resolved
Hide resolved
4cda602
to
631f04d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the right idea.
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
I have a high level question. If we never initiate pings as long as we are receiving frames faster than the KeepAlivePingInterval, why are we waiting specifically for the ping ack to cancel the ping timeout? Why not cancel the timeout whenever we receive any frame? I get that cancelling the timeout whenever we receive any frame does nothing to measure latency, but isn't activity the real thing we want to check? If we want to check latency instead of activity, we should send pings regardless of recent activity. |
That is something I thought about. golang appears to be ok with any data:
I think Java waits on the ping ACK
|
Updated. Open questions:
|
No_error is probably fine. All it means is that the server has decided to close the connection for an arbitrary reason. I don't know if any data vs completed frames is a meaningful distinction in reality. Will the socket even notify us that data is available before it's finished reading a TCP frame? These HTTP/2 frames should fit into a TCP frame most of the time. |
src/Servers/Kestrel/Core/ref/Microsoft.AspNetCore.Server.Kestrel.Core.netcoreapp.cs
Outdated
Show resolved
Hide resolved
@yashykt Hi Yash I'm adding keep alive support to the ASP.NET Core server. It will be useful when hosting gRPC on ASP.NET Core. A couple of questions for you:
|
Hi, the source of truth for keepalives in gRPC is https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md
|
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
Fixes #15104