Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
menghanl opened this issue Oct 15, 2021 · 2 comments

Comments

@menghanl
Copy link
Contributor

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

if len(addrs) <= 0 {
acbw.ac.cc.removeAddrConn(acbw.ac, errConnDrain)
return
}

@menghanl
Copy link
Contributor Author

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

grpc-go/pickfirst.go

Lines 66 to 69 in 36d8757

if len(cs.ResolverState.Addresses) == 0 {
b.ResolverError(errors.New("produced zero addresses"))
return balancer.ErrBadResolverState
}

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

@easwars
Copy link
Contributor

easwars commented Sep 19, 2023

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 easwars closed this as completed Sep 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants