-
Notifications
You must be signed in to change notification settings - Fork 3.9k
rls: fix routeLookupClient may be null in RlsLoadBalancer.requestConnection() #8379
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
rls: fix routeLookupClient may be null in RlsLoadBalancer.requestConnection() #8379
Conversation
@@ -185,7 +185,7 @@ private void handleClusterDiscovered() { | |||
} | |||
LoadBalancerProvider lbProvider = null; | |||
Object lbConfig = null; | |||
if (root.result.lbPolicy() == LbPolicy.RING_HASH) { | |||
if (root.result != null && root.result.lbPolicy() == LbPolicy.RING_HASH) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If root.result is null, then because of the above code, the queue is immediately emptied and instances
is also empty, and because instances
is empty, the code won't reach here.
3e1455f
to
d09ba22
Compare
Ok, how about this? |
@skyguard1 You did find a bug. Thanks! |
@dapengzhang0 It is my pleasure |
@dapengzhang0 Thanks |
ClusterState.result may be null inCdsLoadBalancer2
,can add not-null check to result to avoid NullPointerException, thanksrouteLookupClient
may be null inRlsLoadBalancer.requestConnection()