grpc/grpc-dotnet

Support MAX_CONNECTION_AGE in dotnet server implementation

careless6666 opened this issue · 2 comments

if we look at the grpc documentation https://grpc.io/docs/guides/keepalive/
we see that there is a parameter called MAX_CONNECTION_AGE, we have a parameter in dotnet with similar behavior, but for the client, not for the server, example

new SocketsHttpHandler
        {
            EnableMultipleHttp2Connections = true,
            PooledConnectionIdleTimeout = TimeSpan.FromMinutes(1),
            PooledConnectionLifetime = TimeSpan.FromMinutes(1),
        }

if clients come to me in other languages via grpc, can I somehow set this setting on the server in dotnet?

This is an interesting point because Java supports closing the connection on the server side, but does not close it on the client side, it turns out that the dotnet can communicate with Java normally, but Java cannot, because it is create dns update problems

This is an ASP.NET Core feature. You should request this feature at https://github.com/dotnet/aspnetcore.

I think a way you could create a max lifetime is by writing Kestrel connection middleware and having a timer that aborts the connection context when triggered. If you do this, it's important the clean up the timer if the connection ends sooner to avoid unnecessary resource usage.

thanks