xds:fix cdsLoadBalancer2 childLb shutdown (#7971)

This commit is contained in:
yifeizhuang 2021-03-16 12:37:05 -07:00 committed by GitHub
parent be6192e82a
commit 71c4ef730e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,9 @@ final class CdsLoadBalancer2 extends LoadBalancer {
private void shutdown() {
root.shutdown();
if (childLb != null) {
childLb.shutdown();
}
}
private void handleClusterDiscovered() {

View File

@ -139,6 +139,7 @@ public class CdsLoadBalancer2Test {
loadBalancer.shutdown();
assertThat(xdsClient.watchers).isEmpty();
assertThat(xdsClientRefs).isEqualTo(0);
assertThat(childBalancers).isEmpty();
}
@Test