HeaderExchangeChannel.close will be invoked when zookeeper data is changed. 
(One provider is disapper)

```
close:134, HeaderExchangeChannel 
{org.apache.dubbo.remoting.exchange.support.header}
close:158, HeaderExchangeChannel 
{org.apache.dubbo.remoting.exchange.support.header}
close:133, HeaderExchangeClient 
{org.apache.dubbo.remoting.exchange.support.header}
close:153, ReferenceCountExchangeClient {org.apache.dubbo.rpc.protocol.dubbo}
destroy:144, DubboInvoker {org.apache.dubbo.rpc.protocol.dubbo}
destroy:85, AsyncToSyncInvoker {org.apache.dubbo.rpc.protocol}
destroy:89, ListenerInvokerWrapper {org.apache.dubbo.rpc.listener}
destroy:98, ProtocolFilterWrapper$1 {org.apache.dubbo.rpc.protocol}
destroy:197, ProtocolFilterWrapper$CallbackRegistrationInvoker 
{org.apache.dubbo.rpc.protocol}
destroy:61, InvokerWrapper {org.apache.dubbo.rpc.protocol}
destroyAllInvokers:506, RegistryDirectory 
{org.apache.dubbo.registry.integration}
refreshInvoker:264, RegistryDirectory {org.apache.dubbo.registry.integration}
refreshOverrideAndInvoker:239, RegistryDirectory 
{org.apache.dubbo.registry.integration}
notify:233, RegistryDirectory {org.apache.dubbo.registry.integration}
notify:418, AbstractRegistry {org.apache.dubbo.registry.support}
doNotify:369, FailbackRegistry {org.apache.dubbo.registry.support}
notify:360, FailbackRegistry {org.apache.dubbo.registry.support}
lambda$doSubscribe$2:174, ZookeeperRegistry 
{org.apache.dubbo.registry.zookeeper}
childChanged:-1, 1617937669 
{org.apache.dubbo.registry.zookeeper.ZookeeperRegistry$$Lambda$51}
process:282, CuratorZookeeperClient$CuratorWatcherImpl 
{org.apache.dubbo.remoting.zookeeper.curator}
process:83, NamespaceWatcher {org.apache.curator.framework.imps}
processEvent:533, ClientCnxn$EventThread {org.apache.zookeeper}
run:508, ClientCnxn$EventThread {org.apache.zookeeper}
```

-------

The 
org.apache.dubbo.remoting.transport.dispatcher.all.AllChannelHandler#disconnected
 is invoked by 
org.apache.dubbo.remoting.transport.dispatcher.all.AllChannelHandler#disconnected.

And NettyClientHandler is extend netty ChannelInboundHandler and 
ChannelOutboundHandler. So when the connection between client and server is 
lost, NettyClientHandler will be invoked.

```
"NettyClientWorker-4-1"@3,246 in group "main": RUNNING
disconnected:53, AllChannelHandler 
{org.apache.dubbo.remoting.transport.dispatcher.all}
disconnected:53, HeartbeatHandler 
{org.apache.dubbo.remoting.exchange.support.header}
disconnected:48, AbstractChannelHandlerDelegate 
{org.apache.dubbo.remoting.transport}
disconnected:131, AbstractPeer {org.apache.dubbo.remoting.transport}
channelInactive:69, NettyClientHandler 
{org.apache.dubbo.remoting.transport.netty4}
invokeChannelInactive:245, AbstractChannelHandlerContext {io.netty.channel}
invokeChannelInactive:231, AbstractChannelHandlerContext {io.netty.channel}
fireChannelInactive:224, AbstractChannelHandlerContext {io.netty.channel}
channelInactive:75, ChannelInboundHandlerAdapter {io.netty.channel}
channelInactive:277, IdleStateHandler {io.netty.handler.timeout}
invokeChannelInactive:245, AbstractChannelHandlerContext {io.netty.channel}
invokeChannelInactive:231, AbstractChannelHandlerContext {io.netty.channel}
fireChannelInactive:224, AbstractChannelHandlerContext {io.netty.channel}
channelInputClosed:377, ByteToMessageDecoder {io.netty.handler.codec}
channelInactive:342, ByteToMessageDecoder {io.netty.handler.codec}
invokeChannelInactive:245, AbstractChannelHandlerContext {io.netty.channel}
invokeChannelInactive:231, AbstractChannelHandlerContext {io.netty.channel}
fireChannelInactive:224, AbstractChannelHandlerContext {io.netty.channel}
channelInactive:1429, DefaultChannelPipeline$HeadContext {io.netty.channel}
invokeChannelInactive:245, AbstractChannelHandlerContext {io.netty.channel}
invokeChannelInactive:231, AbstractChannelHandlerContext {io.netty.channel}
fireChannelInactive:947, DefaultChannelPipeline {io.netty.channel}
run:822, AbstractChannel$AbstractUnsafe$8 {io.netty.channel}
safeExecute$$$capture:163, AbstractEventExecutor {io.netty.util.concurrent}
safeExecute:-1, AbstractEventExecutor {io.netty.util.concurrent}
runAllTasks:404, SingleThreadEventExecutor {io.netty.util.concurrent}
run:465, NioEventLoop {io.netty.channel.nio}
run:884, SingleThreadEventExecutor$5 {io.netty.util.concurrent}
run:30, FastThreadLocalRunnable {io.netty.util.concurrent}
run:748, Thread {java.lang}
```

总结下:
org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler#disconnected
 被用于监听server端的连接
 HeaderExchangeChannel#close 用于监听注册中心的连接,当有provider下线时,会调用close。

所以两个都是有意义的。

[ Full content available at: https://github.com/apache/dubbo/pull/4698 ]
This message was relayed via gitbox.apache.org for 
notifications@dubbo.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to