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

balancer: SubConn doesn't recover if UpdateAddress() is called with an empty list

Open menghanl opened this issue 4 years ago • 1 comments

sc.UpdateAddress() closes the addrConn. So if it's called later with an non-empty list, the connection will not recover.

https://github.com/grpc/grpc-go/blob/36d87572dba304d444361ca3ddc77d5a9c0f831c/balancer_conn_wrappers.go#L245-L248

menghanl avatar Oct 15 '21 17:10 menghanl

This isn't a big problem for pick-first because zero address is an error:

https://github.com/grpc/grpc-go/blob/36d87572dba304d444361ca3ddc77d5a9c0f831c/pickfirst.go#L66-L69

But other balancers (e.g. grpclb) will fail (grpclb fixed in #4879)

menghanl avatar Oct 15 '21 17:10 menghanl

Current code puts the subConn in IDLE if it is updated with an empty address list, which seems the right thing to do.

Also, UpdateAddresses is now marked deprecated and will soon be deleted.

easwars avatar Sep 19 '23 23:09 easwars