Skip to content

Commit

Permalink
xds: fix RingHash LB null pointer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dapengzhang0 committed Aug 24, 2021
1 parent 389076d commit 7de1096
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xds/src/main/java/io/grpc/xds/CdsLoadBalancer2.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ private void handleClusterDiscovered() {
if (root.result.lbPolicy() == LbPolicy.RING_HASH) {
lbProvider = lbRegistry.getProvider("ring_hash");
lbConfig = new RingHashConfig(root.result.minRingSize(), root.result.maxRingSize());
} else {
}
if (lbProvider == null) {
lbProvider = lbRegistry.getProvider("round_robin");
lbConfig = null;
}
ClusterResolverConfig config = new ClusterResolverConfig(
Collections.unmodifiableList(instances), new PolicySelection(lbProvider, lbConfig));
Expand Down

0 comments on commit 7de1096

Please sign in to comment.