mirror of https://github.com/grpc/grpc-java.git
xds: fix ring hash childLB acceptResolvedAddress not in syncContext (#10664)
This commit is contained in:
parent
d5544bbb02
commit
ae62785e0b
|
|
@ -425,12 +425,14 @@ final class RingHashLoadBalancer extends MultiChildLoadBalancer {
|
||||||
return PickResult.withNoResult();
|
return PickResult.withNoResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subchannelView.connectivityState == IDLE || childLbState.isDeactivated()) {
|
if (subchannelView.connectivityState == IDLE) {
|
||||||
if (childLbState.isDeactivated()) {
|
syncContext.execute(() -> {
|
||||||
childLbState.activate();
|
if (childLbState.isDeactivated()) {
|
||||||
} else {
|
childLbState.activate();
|
||||||
syncContext.execute(() -> childLbState.getLb().requestConnection());
|
} else {
|
||||||
}
|
childLbState.getLb().requestConnection();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return PickResult.withNoResult(); // Indicates that this should be retried after backoff
|
return PickResult.withNoResult(); // Indicates that this should be retried after backoff
|
||||||
}
|
}
|
||||||
|
|
@ -531,11 +533,10 @@ final class RingHashLoadBalancer extends MultiChildLoadBalancer {
|
||||||
if (!isDeactivated()) {
|
if (!isDeactivated()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentConnectivityState = CONNECTING;
|
currentConnectivityState = CONNECTING;
|
||||||
getLb().switchTo(pickFirstLbProvider);
|
getLb().switchTo(pickFirstLbProvider);
|
||||||
markReactivated();
|
markReactivated();
|
||||||
getLb().acceptResolvedAddresses(this.getResolvedAddresses()); // Time to get a subchannel
|
getLb().acceptResolvedAddresses(this.getResolvedAddresses());
|
||||||
logger.log(XdsLogLevel.DEBUG, "Child balancer {0} reactivated", getKey());
|
logger.log(XdsLogLevel.DEBUG, "Child balancer {0} reactivated", getKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue