What version of gRPC and what language are you using?
In a net8.0/net9.0 C# project, I'm using the following NuGet packages:
- Google.Protobuf/3.33.2
- Grpc.AspNetCore/2.76.0
- Grpc.Tools/2.76.0
What operating system (Linux, Windows,...) and version?
Development is done on Windows 11. Code runs on Windows (desktop or server) or Linux (containers).
What runtime / compiler are you using (e.g. .NET Core SDK version dotnet --info)
9.0.306 for development but expected to run using any 8+ (target multiple frameworks)
What did you do?
My system includes 10+ grpc services which can be configured to use NamedPipe, UDS, or HTTP depending on the deployment implementation. I have factories that perform the setup of the services and clients based on the configuration. I followed some guidance I found online that the channels for clients should be reused because they can be expensive to create, so in my factory that creates clients I want to be able to ensure that a channel hasn't been shutdown or is in an error state before using to generate a new client, but there are no properties that allow checking that aside from the 'State' property, but that property performs some validation and throws an exception in some cases that "client-side load balancing or connectivity state tracking" isn't enabled for the channel, but there is no other way to check if a channel has been shutdown/disposed or is in an error state.
What did you expect to see?
I expect checking if (channel.State is ConnectivityState.Shutdown or ConnectivityState.TransientFailure) to, at a minimum, tell me if the channel has been shutdown. Maybe there's a reason why the TransientFailure can't be reported, but it seems silly that if the channel tried to interact with the service and it failed that it can't report that and has any dependency on client-side load balancing or connectivity state tracking.
What did you see instead?
An exception unrelated to the information that I'm trying to obtain. The exception is thrown from here which is triggered by the State property here.
Anything else we should know about your project / environment?
I don't think so.
What version of gRPC and what language are you using?
In a net8.0/net9.0 C# project, I'm using the following NuGet packages:
What operating system (Linux, Windows,...) and version?
Development is done on Windows 11. Code runs on Windows (desktop or server) or Linux (containers).
What runtime / compiler are you using (e.g. .NET Core SDK version
dotnet --info)9.0.306 for development but expected to run using any 8+ (target multiple frameworks)
What did you do?
My system includes 10+ grpc services which can be configured to use NamedPipe, UDS, or HTTP depending on the deployment implementation. I have factories that perform the setup of the services and clients based on the configuration. I followed some guidance I found online that the channels for clients should be reused because they can be expensive to create, so in my factory that creates clients I want to be able to ensure that a channel hasn't been shutdown or is in an error state before using to generate a new client, but there are no properties that allow checking that aside from the 'State' property, but that property performs some validation and throws an exception in some cases that "client-side load balancing or connectivity state tracking" isn't enabled for the channel, but there is no other way to check if a channel has been shutdown/disposed or is in an error state.
What did you expect to see?
I expect checking
if (channel.State is ConnectivityState.Shutdown or ConnectivityState.TransientFailure)to, at a minimum, tell me if the channel has been shutdown. Maybe there's a reason why the TransientFailure can't be reported, but it seems silly that if the channel tried to interact with the service and it failed that it can't report that and has any dependency on client-side load balancing or connectivity state tracking.What did you see instead?
An exception unrelated to the information that I'm trying to obtain. The exception is thrown from here which is triggered by the State property here.
Anything else we should know about your project / environment?
I don't think so.