Should GrpcChannel provide ChannelBase.ShutdownAsync() functionality?
- 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
Assessment
This issue has not been assessed yet.