grpc / grpc/grpc-dotnet

Should GrpcChannel provide ChannelBase.ShutdownAsync() functionality?

Open
#1,712 5 comments 1 reaction 1 assignee Claimed by @JamesNK View on GitHub
enhancement
Dominant language
C#
Stars
4.5k
Forks
836
Avg merge
6d 3h
Merged PRs (30d)
7

Description

Currently there's a discrepancy in GrpcChannel (grpc-dotnet) and Channel (Grpc.Core) behavior when it comes to shutdown.

- Both classes inherit from ChannelBase, but only Channel provides a meaningful implementation of channel.ShutdownAsync() (through overriding ChannelBase.ShutdownAsyncCore() method). For GrpcChannel, invoking ShutdownAsync() is a no-op.
- on the other hand GrpcChannel provides a Dispose() method (not provided by Channel).

https://github.com/grpc/grpc/blob/1cd6e69347cbf62a012477fe184ee6fa8f25d32c/src/csharp/Grpc.Core.Api/ChannelBase.cs#L72

https://github.com/grpc/grpc/blob/1cd6e69347cbf62a012477fe184ee6fa8f25d32c/src/csharp/Grpc.Core/Channel.cs#L214

The issue is that when using channels gRPC in .NET, one must specialize the channel shutdown based on knowing the concrete implementation of a given channel (and use Channel.ShutdownAsync() or GrpcChannel.Dispose() based on that).

Could this be solved by e.g. making GrpcChannel.ShutdownAsync() basically behave the same way as Dispose()?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.