mirror of https://github.com/grpc/grpc-java.git
core: reorder code in NameResolver.Listener.onAddress()
This commit is contained in:
parent
60e988dc20
commit
283f04983b
|
|
@ -1295,10 +1295,6 @@ final class ManagedChannelImpl extends ManagedChannel implements
|
||||||
channelLogger.log(ChannelLogLevel.INFO, "Service config changed");
|
channelLogger.log(ChannelLogLevel.INFO, "Service config changed");
|
||||||
lastServiceConfig = serviceConfig;
|
lastServiceConfig = serviceConfig;
|
||||||
}
|
}
|
||||||
// Call LB only if it's not shutdown. If LB is shutdown, lbHelper won't match.
|
|
||||||
if (NameResolverListenerImpl.this.helper != ManagedChannelImpl.this.lbHelper) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
nameResolverBackoffPolicy = null;
|
nameResolverBackoffPolicy = null;
|
||||||
|
|
||||||
|
|
@ -1316,11 +1312,14 @@ final class ManagedChannelImpl extends ManagedChannel implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (servers.isEmpty() && !helper.lb.canHandleEmptyAddressListFromNameResolution()) {
|
// Call LB only if it's not shutdown. If LB is shutdown, lbHelper won't match.
|
||||||
handleErrorInSyncContext(Status.UNAVAILABLE.withDescription(
|
if (NameResolverListenerImpl.this.helper == ManagedChannelImpl.this.lbHelper) {
|
||||||
"Name resolver " + resolver + " returned an empty list"));
|
if (servers.isEmpty() && !helper.lb.canHandleEmptyAddressListFromNameResolution()) {
|
||||||
} else {
|
handleErrorInSyncContext(Status.UNAVAILABLE.withDescription(
|
||||||
helper.lb.handleResolvedAddressGroups(servers, config);
|
"Name resolver " + resolver + " returned an empty list"));
|
||||||
|
} else {
|
||||||
|
helper.lb.handleResolvedAddressGroups(servers, config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue