grpc / grpc-go

The Go language implementation of gRPC. HTTP/2 based RPC
https://grpc.io
Apache License 2.0
21.14k stars 4.4k forks source link

SubConn transitions directly from CONNECTING to IDLE #7862

Open zasweq opened 1 week ago

zasweq commented 1 week ago

There is a race when a Subchannel goes from CONNECTING to READY to IDLE that prevents the READY state change notification. We should fix this, as this is causing specific case handling in balancers such as the new pick first leaf policy for DualStack.

arjan-bal commented 1 week ago

The original issue that I opened: https://github.com/grpc/grpc-go/issues/7503

The problem is that the health checking go routine may report a failure before the ready update is sent:https://github.com/grpc/grpc-go/blob/b45fc413ca1ffd56cb2c7fe51220d0ed9167243b/clientconn.go#L1406-L1412

Once we remove health checking from addrConn, the edge case should no longer happen.