grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

Provide an internal-only API to report connectivity state changes on the ClientConn

Open easwars opened this issue 3 years ago • 2 comments

Currently we don't have an API to get connectivity state changes on the ClientConn in a lossless fashion.

Our current state change API is lossy because state changes can be lost between the former returning and the caller invoking GetState.

Other languages provide this API, and we should consider adding this sooner rather than later.

Currently, the RLS LB policy needs a way to monitor the connectivity state of the control channel. The xDS client needs a way to monitor the connectivity state of the channel to the management server.

easwars avatar Nov 28 '22 22:11 easwars

Note that no gRPC language provides a public API to get lossless connectivity state updates, and that is by design: we don't want users expecting to see every individual update, because they should not need to care about the state machinery, only the current state. We should not add such a public API in grpc-go.

Some languages do have internal APIs that provide lossless connectivity state updates. In particular, for example, I think it's quite important that LB policies get lossless updates from subchannels. And it's fine to use such internal APIs at the channel level in cases where we are creating the channel internally (e.g., the xDS channel described in #3823). But we should not make such APIs public for applications to use.

markdroth avatar Nov 28 '22 23:11 markdroth

Thanks for the comment, Mark !!

We will ensure that the added API is an internal-only API.

easwars avatar Nov 29 '22 01:11 easwars