xds: fix order of processing resolution errors with original cluster ordering (#8224)

When aggregating the endpoint resolution errors of the list of clusters in ClusterResolverLoadBalancer, clusters should be processed in its original order as received in the LB config. The last cluster's error is used as the overall error status.
This commit is contained in:
Chengyuan Zhang 2021-06-01 11:22:24 -07:00 committed by GitHub
parent d4e90a78fd
commit a589c2c68f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -254,7 +254,8 @@ final class ClusterResolverLoadBalancer extends LoadBalancer {
private void handleEndpointResolutionError() {
boolean allInError = true;
Status error = null;
for (ClusterState state : clusterStates.values()) {
for (String cluster : clusters) {
ClusterState state = clusterStates.get(cluster);
if (state.status.isOk()) {
allInError = false;
} else {