Hi,

After updating to grpc 1.1.1 it seems that the semantics around using 
NameResolver have changed. Basically in our (working) 1.0.3 NameResolver 
implementation we were doing this in start() :

      Collection<ServiceInstance> serviceInstances = 
provider.getAllInstances(); // provider is a curator.ServiceProvider
      List<ResolvedServerInfo> infoGroups = new ArrayList<>();
      for (ServiceInstance serviceInstance : serviceInstances) {
        infoGroups.add(new ResolvedServerInfo(
            
InetSocketAddress.createUnresolved(serviceInstance.getAddress(), 
serviceInstance.getPort()),
            Attributes.EMPTY));
      }
      listener.onUpdate(Collections.singletonList(infoGroups), 
Attributes.EMPTY);

For 1.1.1 we had to slightly change it to match the listener.onUpdate 
signature change:

      Collection<ServiceInstance> serviceInstances = 
provider.getAllInstances();
      List<ResolvedServerInfo> serverInfos = new ArrayList<>();
      for (ServiceInstance serviceInstance : serviceInstances) {
        serverInfos.add(new ResolvedServerInfo(
            
InetSocketAddress.createUnresolved(serviceInstance.getAddress(), 
serviceInstance.getPort())));
      }
      
listener.onUpdate(Collections.singletonList(ResolvedServerInfoGroup.builder().addAll(serverInfos).build()),
          Attributes.EMPTY);

However when our client now tries to connect to the server we get an 
exception indicating the channel is not active. 

io.grpc.StatusRuntimeException: UNAVAILABLE: Channel in TRANSIENT_FAILURE 
state
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:227)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:208)

Any thoughts what could be going on here ?

Thanks,
Jorg




-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/fef8a833-f5b1-4672-bb45-d16a7e40d661%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to