Skip to content

The gRPC and Unix domain sockets doc lacks warnings about supportability #35871

@skyline75489

Description

@skyline75489

Description

The documentation is very helpful, but it can easily lead to the following exception:

System.InvalidOperationException: Channel is configured with an HTTP transport doesn't support client-side load balancing or connectivity state tracking. The underlying HTTP transport must be a SocketsHttpHandler with no SocketsHttpHandler.ConnectCallback configured. The HTTP transport must be configured on the channel using GrpcChannelOptions.HttpHandler.
at Grpc.Net.Client.GrpcChannel.ValidateHttpHandlerSupportsConnectivity() in /_/src/Grpc.Net.Client/GrpcChannel.cs:line 427 
at Grpc.Net.Client.GrpcChannel..ctor(Uri address, GrpcChannelOptions channelOptions) in /_/src/Grpc.Net.Client/GrpcChannel.cs:line 131
at Grpc.Net.Client.GrpcChannel.ForAddress(Uri address, GrpcChannelOptions channelOptions) in /_/src/Grpc.Net.Client/GrpcChannel.cs:line 708
at Grpc.Net.Client.GrpcChannel.ForAddress(String address, GrpcChannelOptions channelOptions) in /_/src/Grpc.Net.Client/GrpcChannel.cs:line 678

Based on various existence of ValidateHttpHandlerSupportsConnectivity for example here : https://github.com/grpc/grpc-dotnet/blob/f31cd71abfc0e8a8a7b93f447868405b0baebed0/src/Grpc.Net.Client/GrpcChannel.cs#L138C1-L139C1, one needs to make sure:

  • ServiceConfig?.LoadBalancingConfigs can't exist
  • Neither ConnectivityState nor WaitForStateChangedAsync can be invoked.

I think we need to clarify this in the documentation.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/grpc/interprocess-uds?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/grpc/interprocess-uds.md

Document ID

9af2ca8f-eefb-ae3d-ba52-d6b2a826945d

Platform Id

52d86246-3466-b842-2ee0-35cdd744c0c4

Article author

@JamesNK

Metadata

  • ID: 9af2ca8f-eefb-ae3d-ba52-d6b2a826945d
  • PlatformId: 52d86246-3466-b842-2ee0-35cdd744c0c4
  • Service: aspnet-core
  • Sub-service: grpc

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions