Skip to content
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

xds: routing policy should immediately update a picker that selects base on updated config #7233

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions xds/src/main/java/io/grpc/xds/XdsRoutingLoadBalancer.java
Expand Up @@ -86,14 +86,14 @@ public void handleResolvedAddresses(final ResolvedAddresses resolvedAddresses) {
} else {
childLbStates.get(actionName).reactivate(action.getProvider());
}
final LoadBalancer childLb = childLbStates.get(actionName).lb;
syncContext.execute(new Runnable() {
@Override
public void run() {
childLbStates.get(actionName).lb
.handleResolvedAddresses(
resolvedAddresses.toBuilder()
.setLoadBalancingPolicyConfig(action.getConfig())
.build());
childLb.handleResolvedAddresses(
resolvedAddresses.toBuilder()
.setLoadBalancingPolicyConfig(action.getConfig())
.build());
}
});
}
Expand All @@ -102,6 +102,7 @@ public void run() {
for (String actionName : diff) {
childLbStates.get(actionName).deactivate();
}
updateOverallBalancingState();
}

@Override
Expand Down Expand Up @@ -235,12 +236,11 @@ private final class RouteHelper extends ForwardingLoadBalancerHelper {

@Override
public void updateBalancingState(ConnectivityState newState, SubchannelPicker newPicker) {
if (deactivated) {
return;
}
currentState = newState;
currentPicker = newPicker;
updateOverallBalancingState();
if (!deactivated) {
updateOverallBalancingState();
}
}

@Override
Expand Down