-
Notifications
You must be signed in to change notification settings - Fork 666
Skip the remaining callbacks on connectivity state change #2419
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
Conversation
Skip the remaining callbacks in subchannel.transitionToState() if connectivity state has been changed before callback called. Connectivity state could be changed by calling client.close. As a result - infinite busyloop in LoadBalancingCall.doPick().
The change seems reasonable, but I don't understand the test. Why should |
|
And this change doesn't actually cause the subchannel's state to not change, it just causes it to not notify listeners of the change. Maybe a better solution would be to call the listener with |
Unfortunately, In the case of 2 clients, there are 4 registered connectivity state listeners in the beginning of transition
2nd listener calls call stack (line numbers could be a little bit different due to some debug prints)
call stack
1st attempt
2nd attempt
Array TL;DR |
This is the bug. And actually, when I fix that, there is another bug elsewhere. I now believe that the change you have here is not what is needed. I'll put together a separate PR. |
I published version 1.8.14 with a change that seems to fix this problem. Please try it out. |
It works as expected. |
Skip the remaining callbacks in
subchannel.transitionToState()
if connectivity state has been changed before callbacks called.Connectivity state could be changed by calling
client.close()
inside a callback.As a result - infinite busy loop in
LoadBalancingCall.doPick()
.It affected etcd3 client library.