mirror of https://github.com/grpc/grpc-java.git
core: propagate name resolution errors
This commit is contained in:
parent
ff7fb5ff52
commit
5384f9706a
|
|
@ -249,9 +249,14 @@ public final class ManagedChannelImpl extends ManagedChannel implements WithLogI
|
||||||
class NameResolverStartTask implements Runnable {
|
class NameResolverStartTask implements Runnable {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
NameResolverListenerImpl listener = new NameResolverListenerImpl(balancer);
|
||||||
// This may trigger quite a few non-trivial work in LoadBalancer and NameResolver,
|
// This may trigger quite a few non-trivial work in LoadBalancer and NameResolver,
|
||||||
// we don't want to do it in the lock.
|
// we don't want to do it in the lock.
|
||||||
resolver.start(new NameResolverListenerImpl(balancer));
|
try {
|
||||||
|
resolver.start(listener);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
listener.onError(Status.fromThrowable(t));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue