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

Definative guidance for keepalive using gRPC server side streaming #2588

Open
Tommo56700 opened this issue Jan 3, 2025 · 0 comments
Open
Labels
question Further information is requested

Comments

@Tommo56700
Copy link

Tommo56700 commented Jan 3, 2025

I am hoping to get my head around server side keepalive settings in grpc-dotnet.

Scenario

Push based notifications. The client starts a streaming call which they expect to be long lived (for the duration of the program). The server can send push notifications via streaming to the client. The stream can become idle for long periods of time if there are no new notifications to be sent, but the connection should still be kept "warm".

This is running in an environment with a network firewall that will kill connections without traffic for an hour.

In this case, I have an ASP.NET 8 Server, and a Python Client.

Problem

I can't find definitive guidance on how to configure both sides for the above scenario. I am getting an error on the client after an hour of inactivity:

status = StatusCode.UNAVAILABLE
details = "Socket closed"
debug_error_string = "UNKNOWN:Error received from peer"

I have done a fair amount of extra reading:

gRPC docs highlight the importance of server and client settings being configured together. What I find somewhat confusing is that many of the keepalive configurations do not seem to be settable via the ASP.NET server e.g:

  • keepalive_time_ms
  • keepalive_permit_without_calls
  • max_pings_without_data

It seems the explanation for this is that Kestrel handles keepalive itself (which I think is enabled by default?). My confusion probably stems from my lack of understanding about Kestrel. But I would appreciate it if someone could point me in the right direction.

@Tommo56700 Tommo56700 added the question Further information is requested label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant