|
Repo Added
|
Files
630
|
Badge
README BADGES
|
push
github
xds: reuse GrpcXdsTransport and underlying gRPC channel to the same xDS server by ref-counting This PR implements reusing the gRPC xDS transport (and underlying gRPC channel) to the same xDS server by ref-counting, which is already implemented in gRPC C++ ([link](https://github.com/grpc/grpc/blob/5a3a5d531/src/core/xds/grpc/xds_transport_grpc.cc#L399-L414)) and gRPC Go ([link](https://github.com/grpc/grpc-go/blob/81c7924ec/internal/xds/clients/grpctransport/grpc_transport.go#L78-L120)). This optimization is expected to reduce memory footprint of the xDS management server and xDS enabled clients as channel establishment and lifecycle management of the connection is expensive. * Implemented a map to store `GrpcXdsTransport` instances keyed by the `Bootstrapper.ServerInfo` and each `GrpcXdsTransport` has a ref count. Note, the map cannot be simply keyed by the xDS server address as the client could have different channel credentials to the same xDS server, which should be counted as different transport instances. * When `GrpcXdsTransportFactory.create()` is called, the existing transport is reused if it already exists in the map and increment its ref count, otherwise create a new transport, store it in the map, and increment its ref count. * When `GrpcXdsTransport.shutdown()` is called, its ref count is decremented and the underlying gRPC channel is shut down when its ref count reaches zero. * Note this ref-counting of the `GrpcXdsTransport` is different and orthogonal to the ref-counting of the xDS client keyed by the xDS server target name to allow for xDS-based fallback per [gRFC A71](https://github.com/grpc/proposal/blob/master/A71-xds-fallback.md). Prod risk level: Low * Reusing the underlying gRPC channel to the xDS server would not affect the gRPC xDS (ADS/LRS) streams which would be multiplexed on the same channel, however, this means new xDS (ADS/LRS) streams and RPCs may fail due ... (continued)
35473 of 39995 relevant lines covered (88.69%)
0.89 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|