Hi Kun,
Based on your input, once a new server (server 3 listening on 9097, once it
is ready, LB will be notified and updated, however I see from the log,
server3 is in ready state, but the request is never routed to server3, can
you please suggest where should I look into the issue? Thanks a lot!
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) NameResolver is
notified there is a change in Registry...
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) NameResolver is
notified there is a change in Registry...
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) NameResolver is
notified there is a change for interested service xxxx, refreshing now...
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) NameResolver is
notified there is a change for interested service xxxx, refreshing now...
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) NameResolver
Refreshing ...
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) NameResolver
Refreshing ...
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) trying to
resolve
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) trying to
resolve
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) NameResolver
resolve completed
[RegistryNameResolver] (registry-refresher-safe-2-thread-1) NameResolver
resolve completed
[RegistryNameResolver] (registry-name-resolver-safe-6-thread-1) Resolving
for service name: xxxx
[RegistryNameResolver] (registry-name-resolver-safe-6-thread-1) Resolving
for service name: xxxx
[RegistryNameResolver] (registry-name-resolver-safe-6-thread-1) Notifying
with address size: 2, list: [[addrs=[localhost/127.0.0.1:9096], attrs={}],
[addrs=[localhost/127.0.0.1:9097], attrs={}]]
[RegistryNameResolver] (registry-name-resolver-safe-6-thread-1) Notifying
with address size: 2, list: [[addrs=[localhost/127.0.0.1:9096], attrs={}],
[addrs=[localhost/127.0.0.1:9097], attrs={}]]
[io.grpc.internal.ManagedChannelImpl]
(registry-name-resolver-safe-6-thread-1)
[io.grpc.internal.ManagedChannelImpl-4] resolved address:
[[addrs=[localhost/127.0.0.1:9096], attrs={}],
[addrs=[localhost/127.0.0.1:9097], attrs={}]], config={}
[io.grpc.internal.ManagedChannelImpl]
(registry-name-resolver-safe-6-thread-1)
[io.grpc.internal.ManagedChannelImpl-4] resolved address:
[[addrs=[localhost/127.0.0.1:9096], attrs={}],
[addrs=[localhost/127.0.0.1:9097], attrs={}]], config={}
[io.grpc.internal.ManagedChannelImpl]
(registry-name-resolver-safe-6-thread-1)
[io.grpc.internal.ManagedChannelImpl-4]
io.grpc.internal.InternalSubchannel-8 created for
[[addrs=[localhost/127.0.0.1:9097], attrs={}]]
[io.grpc.internal.ManagedChannelImpl]
(registry-name-resolver-safe-6-thread-1)
[io.grpc.internal.ManagedChannelImpl-4]
io.grpc.internal.InternalSubchannel-8 created for
[[addrs=[localhost/127.0.0.1:9097], attrs={}]]
[io.grpc.internal.InternalSubchannel]
(registry-name-resolver-safe-6-thread-1)
[io.grpc.internal.InternalSubchannel-8] Created
io.grpc.netty.NettyClientTransport-9 for localhost/127.0.0.1:9097
[io.grpc.internal.InternalSubchannel]
(registry-name-resolver-safe-6-thread-1)
[io.grpc.internal.InternalSubchannel-8] Created
io.grpc.netty.NettyClientTransport-9 for localhost/127.0.0.1:9097
[io.grpc.internal.InternalSubchannel] (grpc-default-worker-ELG-3-3)
[io.grpc.internal.InternalSubchannel-8]
io.grpc.netty.NettyClientTransport-9 for localhost/127.0.0.1:9097 is ready
[io.grpc.internal.InternalSubchannel] (grpc-default-worker-ELG-3-3)
[io.grpc.internal.InternalSubchannel-8]
io.grpc.netty.NettyClientTransport-9 for localhost/127.0.0.1:9097 is ready
On Thursday, January 17, 2019 at 4:35:29 PM UTC-8, [email protected]
wrote:
>
> Got it! Thanks a lot
>
> On Thursday, January 17, 2019 at 2:35:54 PM UTC-8, Kun Zhang wrote:
>>
>> You don't need to worry about the timing. As soon as the Subchannel
>> becomes ready, RoundRobinLoadBalancer should notice that by yet another
>> call to updateBalancingState() and add it to the round-robin list. If
>> you continue debugging, you should be able to see that.
>>
>> On Wednesday, January 16, 2019 at 1:44:41 PM UTC-8, [email protected]
>> wrote:
>>>
>>> Hi Kun,
>>>
>>> I am trying to debug further, in
>>> io.grpc.util.RoundRobinLoadBalancerFactory::handleResolvedAddressGroups
>>> will be called if the NameResolver.Listener::onAddress is called,
>>>
>>> inside handleResolvedAddressGroups method, it is calling
>>> updateBalancingState(getAggregatedState(),
>>> getAggregatedError()); where it seems in getAggregatedState(),
>>> it is not returning the subchannel state as READY, sometimes connecting,
>>> sometimes idle.
>>>
>>> Then in updateBalancingState(), it will only put those subchannel's
>>> state with READY in the activeList.
>>>
>>> So just wonder is there anyway to ensure the sub channel is READY when
>>> updating the loadbalancer ?
>>>
>>> On Wednesday, January 16, 2019 at 12:50:04 PM UTC-8, [email protected]
>>> wrote:
>>>>
>>>> Hi Kun,
>>>>
>>>> I did see that the new server3 (listening on 9097) has its
>>>> InternalSubchannel gets created:
>>>>
>>>> [io.grpc.internal.InternalSubchannel] (grpc-default-worker-ELG-3-9)
>>>> [io.grpc.internal.InternalSubchannel-20]
>>>> io.grpc.netty.NettyClientTransport-21 for localhost/127.0.0.1:9097 is
>>>> ready
>>>> [io.grpc.internal.InternalSubchannel] (grpc-default-worker-ELG-3-9)
>>>> [io.grpc.internal.InternalSubchannel-20]
>>>> io.grpc.netty.NettyClientTransport-21 for localhost/127.0.0.1:9097 is
>>>> ready
>>>>
>>>> On Wednesday, January 9, 2019 at 10:18:47 AM UTC-8, [email protected]
>>>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> in my java gRPC client, when I create the ManagedChannel, I am passing
>>>>> my custom NameResolver, and using RoundRobinLoadBalancer. When my
>>>>> NameResolver is notified with a change to the server list (new server
>>>>> added), it will call Listener.onAddress and pass the updated the list.
>>>>>
>>>>> I see from the Log: the onAddress is called from
>>>>> NameResolverListenerImpl, (9097 is the new server address added)
>>>>>
>>>>> resolved address: [[addrs=[localhost/127.0.0.1:9096], attrs={}],
>>>>> [addrs=[localhost/127.0.0.1:9097], attrs={}]], config={}
>>>>>
>>>>>
>>>>> however, the traffic is not coming to the new server, did I miss
>>>>> anything?
>>>>>
>>>>>
>>>>> Thanks a lot!
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
--
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/9440d8ef-784c-4004-8ae3-c20b2ff1f1e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.