You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/23 11:27:40 UTC

[GitHub] [dubbo] owen200008 opened a new issue #8895: #8872 transfer layer session no close

owen200008 opened a new issue #8895:
URL: https://github.com/apache/dubbo/issues/8895


   ### Environment
   
   * Dubbo version: 2.7.14
   * Operating System version: win,centos
   * Java version: jdk8 & jdk11
   
   ### Steps to reproduce this issue
   
   for 1, n do
     1. instance = ReferenceConfig.get();  
     2. call instance.func() success();
     3. ReferenceConfig.destroy()
   end
   
   the exchangeclient no close. 
   the connects = n * set connects
   
   ### Expected Result
   ReferenceConfig set connects = 5
   and the connect session size = 5 * n
   the exchange client resource no gc.
   
   ### Actual Result
   
   in my case, the old-gen use too much  and full gc call frequently 
   
   now i find two problem
   1. transfer layer, close exception
   
   
   have two same service(hotload ReferenceConfig), notify each other then
   2. Registration Center notify and close session will connect again, and new ReferenceConfig will connect, so the connect session size also = 5 * n
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925735598


   第一个问题我希望的解法是
   1. 网络层close函数还是代表关闭的意思,不增加其他意图,引用计数的ReferenceCountExchangeClient的close逻辑只是多了一层引用计数的判断,如果为0了还是需要关闭
   2. 业务层(目前是协议层)决定网络层行为(持续连接还是非持续连接),因此分为下面三个类
   (2.1)ReferenceCountExchangeClient(未来还是希望以这个为主,更加纯粹)
   (2.2)NerverDieReferenceCountExchangeClient(为了兼容)
   (2.3)LazyConnectExchangeClient(废除了NerverDie后,这个逻辑也就非常简单就是贪婪模式)
   3. DubboProtocal那边对share模式的修改,智能指针方式保证引用有效,如果无效就直接销毁重建,逻辑更加简单
   4. 为后续销毁reference(destroyAll)铺路
   5. 目前手动destroy的话,自动创建的invoke是不会销毁的,因此资源还是被占用的,但是后续如果销毁功能做好就没问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927445615


   > ```
   > 		ZookeeperRegistry(FailbackRegistry).unsubscribe(URL, NotifyListener) line: 329	
   > 		ListenerRegistryWrapper.unsubscribe(URL, NotifyListener) line: 129	
   > 		RegistryDirectory<T>(DynamicDirectory<T>).destroy() line: 241	
   > 		FailoverClusterInvoker<T>(AbstractClusterInvoker<T>).destroy() line: 112	
   > 		AbstractCluster$InterceptorInvokerNode<T>.destroy() line: 118	
   > 		MockClusterInvoker<T>.destroy() line: 78	
   > 		MigrationInvoker<T>.destroy() line: 192	
   > 		MigrationInvoker<T>(Invoker<T>).destroyAll() line: 50	
   > 		CommuLink.close() line: 44	
   > 		CommuLink.main(String[]) line: 66
   > ```
   > 
   > 虽然上面是zk的解除注册过程,nacos应该也是如此,可能MockClusterInvoker.java和DynamicDirectory.java 并不需要修改。
   
   后来我又想了下,MockClusterInvoker里面还是要调用Directory的destroy的,Directory对象自己没有管理器管理自己的析构,都是在构造函数的时候赋值给别人管理,所以他本身就应该允许多次调用destroy,给固定的容错层来析构感觉不合适


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925735598


   第一个问题我希望的解法是
   1. 网络层close函数还是代表关闭的意思,不增加其他意图,引用计数的ReferenceCountExchangeClient的close逻辑只是多了一层引用计数的判断,如果为0了还是需要关闭
   2. 业务层(目前是协议层)决定网络层行为(持续连接还是非持续连接),因此分为下面三个类
   (2.1)ReferenceCountExchangeClient(未来还是希望以这个为主,更加纯粹)
   (2.2)NerverDieReferenceCountExchangeClient(为了兼容)
   (2.3)LazyConnectExchangeClient(废除了NerverDie后,这个逻辑也就非常简单就是贪婪模式)
   3. 为后续销毁reference(destroyAll)铺路
   4. 目前手动destroy的话,自动创建的invoke是不会销毁的,因此资源还是被占用的,但是后续如果销毁功能做好就没问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925921437


   我跟踪了一下,问题2个:
   1.CommuLink的close方法里的invoker.destroyAll()执行的invoker类型是MigrationInvoker,这个类型的destroyAll()方法还是调用的destroy()
   2. 经过多个invoker类型的嵌套调用之后,调用了DubboInvoker的destroy调用,然后HeaderExchangeChannel的close(10000),然后调用close(),由于 #7410 修订存在的问题,导致直接返回,没有关闭channel。
   
   应急办法:
   默认的10000ms是ConfigurationUtils.getServerShutdownTimeout()方法返回的,可以设置环境变量dubbo.service.shutdown.wait为0,从而直接调用close()方法规避此缺陷。
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925760049


   2.7.14我本地仓库已经被我修改的替换了,我需要重新编译提交下,需要等下


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928635122


   对于存在多个使用同一个Directory的invoker,析构其中一个invoker顺带把directory也析构掉?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-926998262


   你是对的 nacos没实现 unsub 所以才有问题2 #8907 这个问题2修复我已经提交了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925761201


   @Slf4j
       public static class CommuLink {
   
           private ReferenceConfig<DubboVersionFacade> reference = null;
           @Getter
           private DubboVersionFacade uChannelInstance = null;
   
           public boolean init() {
               //需要初始化
               this.reference = new ReferenceConfig<>();
               reference.setRegistryIds("nacos-registry");
               reference.setInterface(DubboVersionFacade.class);
               reference.setVersion("1.0.0");
               reference.setGroup("main");
   
               //这边是纯异步处理
   //            reference.setAsync(true);
               reference.setCheck(false);
   
               reference.setConnections(5);
               try{
                   this.uChannelInstance = reference.get();
                   return true;
               }catch(Exception e){
                   BasicLogUtil.errorFormat(log, "reference get error", e);
               }
               return false;
           }
   
           public void close() {
   //            reference.destroy();
               try {
                   Method getInvoker = ReferenceConfig.class.getDeclaredMethod("getInvoker");
                   getInvoker.setAccessible(true);
                   Invoker<?> invoker = (Invoker<?>) getInvoker.invoke(reference);
                   invoker.destroyAll();
               } catch (NoSuchMethodException e) {
                   e.printStackTrace();
               } catch (IllegalAccessException e) {
                   e.printStackTrace();
               } catch (InvocationTargetException e) {
                   e.printStackTrace();
               }
           }
       }
   
       @Test
       public void checkDubboReference() throws InterruptedException {
   
           CommuLink lastLink = null;
           for(int i = 0;i < 10;i++){
               if(lastLink != null){
                   lastLink.close();
               }
               CommuLink commuLink = new CommuLink();
               commuLink.init();
               lastLink = commuLink;
   
               Thread.sleep(10000);
               System.out.println(i);
           }
       }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925760049


   2.7.14我本地仓库已经被我修改的替换了,我需要重新编译提交下,需要等下
   目前maven仓库还没2.7.14的,我都是自己修改了提交一个2.7.14-fix的版本,被我自己替换了,哎


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-926440893


   #8907


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925726774


   #8872


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927102007


   > 你是对的 nacos没实现 unsub 所以才有问题2 #8907 这个问题2修复我已经提交了
   
   NacosRegistry的doUnregister就是解除注册的,DynamicDirectory调用ListenerRegistryWrapper的destroy时,最终调用FailbackRegistry的unregister方法时会调用NacosRegistry的doUnregister方法。
   你可以自己debug跟踪一下看看这个过程。
   你遇到的问题2感觉不是没有解除注册,而是还有这个URL还有其他订阅者。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-926998847


   有一个点不同 RegistryDirectory我记得是没调用destroy的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925767606


   我的case也是非常好重现的
   A1 和 A2两个服务 
   A1的ReferenceConfig group配置成A2
   A2的ReferenceConfig group配置成A1
   
   然后A1和A2服务监听nacos的配置,原来连接数为5后面改成10
   那么A1=>A2的连接数为15,A2=>A1的连接数为15
   
   我们有30个机房每个机房最少10台,每个机房配置10个连接,这样热加载一次连接数直接从3000变6000,我们底层又加了lz4的pipeline,一个连接占用64K,内存直接暴涨


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928979463


   现在MockClusterInvoker同时使用Directory和Invoker,二者相互隐式引用,维护和扩展代码都容易出问题,建议重构一下:
   1. MockClusterInvoker构造方法入参类型改为AbstractClusterInvoker,通过AbstractClusterInvoker.getDirectory()访问Directory;
   2. MockClusterWrapper的join方法返回类型改为AbstractClusterInvoker<T>。
   
   @chickenlj 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928689014


   > 对于存在多个使用同一个Directory的invoker,析构其中一个invoker顺带把directory也析构掉?
   
   多个invoke使用同一个Directory,目前我看代码应该都是在同一个责任链里面的,所以这边多个使用同一个的场景都是不同接口的invoker概念


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927102007


   > 你是对的 nacos没实现 unsub 所以才有问题2 #8907 这个问题2修复我已经提交了
   
   NacosRegistry的doUnregister就是解除注册的,DynamicDirectory调用ListenerRegistryWrapper的destroy时,最终调用FailbackRegistry的unregister方法时会调用NacosRegistry的doUnregister方法。
   
   看到了,NacosRegistry的doUnsubscribe没有解除订阅。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925921437


   我跟踪了一下,问题2个:
   1. invoker.destroyAll()执行的invoker类型是MigrationInvoker,这个类型的destroyAll()方法还是调用的destroy()
   2. 经过多个invoker类型的嵌套调用之后,调用了DubboInvoker的destroy调用,然后HeaderExchangeChannel的close(10000),然后调用close(),由于 #7410 修订存在的问题,导致直接返回,没有关闭channel。
   
   应急办法:
   默认的10000ms是ConfigurationUtils.getServerShutdownTimeout()方法返回的,可以设置环境变量dubbo.service.shutdown.wait为0,从而直接调用close()方法规避此缺陷。
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927445287


   我们有跨中心的调用场景,存在多中心nacos服务实例同步问题,随着规模的增大,心跳连接数量激增、服务实例同步不及时、应用大规模重启时注册请求瞬间爆炸等等


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925921437


   我跟踪了一下,问题2个:
   1.CommuLink的close方法里的invoker.destroyAll()执行的invoker类型是MigrationInvoker,这个类型的destroyAll()方法还是调用的destroy()
   2. 经过多个invoker类型的嵌套调用之后,调用了DubboInvoker的destroy调用,然后HeaderExchangeChannel的close(10000),然后调用close(),由于 #7410 修订存在的问题,导致直接返回,没有关闭channel。
   
   应急办法:
   默认的10000ms是ConfigurationUtils.getServerShutdownTimeout()方法返回的,可以通过设置环境变量```dubbo.service.shutdown.wait```为0, 或者在应用启动命令增加JVM参数 ```-Ddubbo.service.shutdown.wait=0```规避此缺陷:shutdown等待时间为0时,不会再调用close(timeout)方法,而是直接调用close()方法关闭channel。
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925738171


   第二个问题目前我指定用ReferenceCountExchangeClient不带lazy的模式的话就支持了,虽然invoke还在 但是网络层已经关闭
   后续销毁接口支持,那么这边就可以被回收了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928935201


   MockClusterInvoker这个类搞Directory和invoker两个成员的确是很别扭:
   ```
       @Override
       public boolean isDestroyed() {
           return directory.isDestroyed();  <== 1
       }
       ...
       @Override
       public void destroy() {
           this.invoker.destroy(); <== 2
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928689014






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-926997602


   @owen200008 
   我用 #8880 (使用了内置zk)的测试案例跟踪了一下,CommuLink.close先去调用了zk的unregister方法,调用过程如下:
   	ZookeeperRegistry(AbstractRegistry).unregister(URL) line: 295	
   	ZookeeperRegistry(FailbackRegistry).unregister(URL) line: 250	
   	ListenerRegistryWrapper.unregister(URL) line: 81	
   	RegistryDirectory<T>(DynamicDirectory<T>).destroy() line: 233	
   	FailoverClusterInvoker<T>(AbstractClusterInvoker<T>).destroy() line: 112	
   	AbstractCluster$InterceptorInvokerNode<T>.destroy() line: 118	
   	MockClusterInvoker<T>.destroy() line: 78	
   	MigrationInvoker<T>.destroy() line: 192	
   	MigrationInvoker<T>(Invoker<T>).destroyAll() line: 50	
   	CommuLink.close() line: 41	
   	CommuLink.main(String[]) line: 63	
   然后才去调用DubboInvoker的close方法,所以没有重新你说的问题2。
   
   dubbo集成测试使用的代码是dubbo-samples, 建议你看一下 https://github.com/apache/dubbo-samples,
   然后参照 #8880 所说的方法新增一个用于验证你的问题的集成测试案例,只是如果用nacos,你还需要先启动一个nacos注册中心,通过集成测试案例本机debug调试确认问题比较快。
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928940466


   Directory应该是没有共享概念的,只是同接口里面invoke管理的,所以我不太建议用智能指针方式实现哈,搞复杂了,只要支持重复析构就可以了
   MockClusterInvoker确实看的就比较奇怪,不好理解


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927102007


   > 你是对的 nacos没实现 unsub 所以才有问题2 #8907 这个问题2修复我已经提交了
   
   看到了,NacosRegistry的doUnsubscribe方法没有解除订阅。
   
   nacos我们也在用,当初以为和阿里自己的configserver差不太多,但是现实和理想还是有很大距离的,nacos单中心部署没啥毛病,应用规模大了、要多中心部署了你可能就会遇到很多坑,这些问题全部指望社区解决不太现实,有实力就自己动手,没有实力就需要提前想其他办法了,推荐去github找一下蚂蚁金服的SOFARegistry,和nacos的功能对比一下看看,怎么说呢,感觉SOFARegistry和configServer更类似。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928940466


   Directory应该是没有共享概念的,只是同接口里面invoke管理的,所以我不太造成用智能指针方式实现哈,搞复杂了,只要支持重复析构就可以了
   MockClusterInvoker确实看的就比较奇怪,不好理解


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925761201






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928635122






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-926999608


   RegistryDirectory通过父类DynamicDirectory调用的registry.unregister,你的代码是不是没有设置applicationConfig?
   ```
   RegistryConfig registryConfig = new RegistryConfig();
   registryConfig.setAddress("zookeeper://127.0.0.1:2181");
   
   ApplicationConfig applicationConfig = new ApplicationConfig("commuLink");
   applicationConfig.setRegistry(registryConfig);
   
   ReferenceConfig<DemoService> reference = new ReferenceConfig<>();
   reference.setApplication(applicationConfig);  《== 我没有看到你提及这个
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928979463


   现在MockClusterInvoker同时使用Directory和Invoker,二者相互隐式引用,维护和扩展代码都容易出问题,
   ```
       @Override
       public boolean isDestroyed() {
           return directory.isDestroyed();  <== 1
       }
       ...
       @Override
       public void destroy() {
           this.invoker.destroy(); <== 2
       }
   ```
   建议重构一下:
   1. MockClusterInvoker构造方法入参类型改为AbstractClusterInvoker,通过AbstractClusterInvoker.getDirectory()访问Directory;
   2. MockClusterWrapper的join方法返回类型改为AbstractClusterInvoker<T>。
   
   @chickenlj 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927496534


   我们也是多中心多机房的,我觉得跨机房调用和内部调用还是要分开使用代理模式更加好,环境和要求不同
   所以每个中心都是单独nacos集群规避了这些问题,我们追求单元化所以可能不会出现你们的场景


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927442710


   > > 你是对的 nacos没实现 unsub 所以才有问题2 #8907 这个问题2修复我已经提交了
   > 
   > 看到了,NacosRegistry的doUnsubscribe方法没有解除订阅的原因是NacosNamingServiceWrapper没有unsubscribe方法。
   > 
   > nacos我们也在用,当初以为和阿里自己的configserver差不太多,但是现实和理想还是有很大距离的,nacos单中心部署没啥毛病,应用规模大了、要多中心部署了你可能就会遇到很多坑,这些问题全部指望社区解决不太现实,有实力就自己动手,没有实力就需要提前想其他办法了,推荐去github找一下蚂蚁金服的SOFARegistry,和nacos的功能对比一下看看,怎么说呢,感觉SOFARegistry和configServer更类似。
   
   
   
   > > 你是对的 nacos没实现 unsub 所以才有问题2 #8907 这个问题2修复我已经提交了
   > 
   > 看到了,NacosRegistry的doUnsubscribe方法没有解除订阅的原因是NacosNamingServiceWrapper没有unsubscribe方法。
   > 
   > nacos我们也在用,当初以为和阿里自己的configserver差不太多,但是现实和理想还是有很大距离的,nacos单中心部署没啥毛病,应用规模大了、要多中心部署了你可能就会遇到很多坑,这些问题全部指望社区解决不太现实,有实力就自己动手,没有实力就需要提前想其他办法了,推荐去github找一下蚂蚁金服的SOFARegistry,和nacos的功能对比一下看看,怎么说呢,感觉SOFARegistry和configServer更类似。
   
   你的单中心和多中心是说的网络问题是吗?目前单中心集群是满足我们的要求的,跨机房调用部分目前我们是不会通过nacos做服务发现的,我们是采用代理的方式实现,代理完成双向鉴权,加密、压缩传输
   能否说下遇到过什么问题,我可以针对性去看下,谢谢哈


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927445287


   我们有跨中心的调用场景,存在多中心nacos服务实例同步问题,随着规模的增大,心跳连接数量激增、服务实例同步不及时、应用大规模重启时注册请求数量以及服务实例变动通知数量瞬间爆炸等等


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925735598


   第一个问题我希望的解法是
   1. 网络层close函数还是代表关闭的意思,不增加其他意图,引用计数的ExchangeClientReferenceCountExchangeClient的close逻辑只是多了一层引用计数的判断,如果为0了还是需要关闭
   2. 业务层(目前是协议层)决定网络层行为(持续连接还是非持续连接),因此分为下面三个类
   (2.1)ReferenceCountExchangeClient(未来还是希望以这个为主,更加纯粹)
   (2.2)NerverDieReferenceCountExchangeClient(为了兼容)
   (2.3)LazyConnectExchangeClient(废除了NerverDie后,这个逻辑也就非常简单就是贪婪模式)
   3. 为后续销毁reference(destroyAll)铺路
   4. 目前手动destroy的话,自动创建的invoke是不会销毁的,因此资源还是被占用的,但是后续如果销毁功能做好就没问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925769871


   A就是个代理服务支持压缩,支持加密,支持鉴权
   前期单机房闭环,后面多机房部署的时候可以微服务的代码不用改直接
   A服务热加载配置,代理最终机房的服务


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925735598






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925763759


   destroyAll一样的 连接没断开


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927102007


   > 你是对的 nacos没实现 unsub 所以才有问题2 #8907 这个问题2修复我已经提交了
   
   看到了,NacosRegistry的doUnsubscribe方法没有解除订阅。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928689014






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925784248


   close方法最后还需要做reference.destroy(); 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927003738


   springboot 工程 配置加载的 我看到mock里面的成员 directory没有调用destroy 看你的堆栈是在failover调用的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925743542


   for 1, n do
   instance = ReferenceConfig.get();
   call instance.func() success();
   ReferenceConfig.getInvoker().destroyAll();  <== 加上这个语句直接关闭URL对应的channel,再试试原生的2.7.14还有没有资源泄露
   ReferenceConfig.destroy();
   end


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925743542


   for 1, n do
   instance = ReferenceConfig.get();
   call instance.func() success();
   ReferenceConfig.getInvoker.destroyAll();  <== 加一个这个试试原生的2.7.14还有没有资源泄露
   ReferenceConfig.destroy();
   end


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927102007


   > 你是对的 nacos没实现 unsub 所以才有问题2 #8907 这个问题2修复我已经提交了
   
   NacosRegistry的doUnregister就是解除注册的,DynamicDirectory调用ListenerRegistryWrapper的destroy时,最终调用FailbackRegistry的unregister方法时会调用NacosRegistry的doUnregister方法。
   你可以自己debug跟踪一下看看这个过程。
   你遇到的问题2感觉不是没有解除注册,而是这个URL还有其他订阅者。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] owen200008 edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
owen200008 edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928689014


   > 对于存在多个使用同一个Directory的invoker,析构其中一个invoker顺带把directory也析构掉?
   
   多个invoke使用同一个Directory,目前我看代码应该都是在同一个责任链里面的,所以这边多个使用同一个的场景都是同接口的invoker概念


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928979463


   现在MockClusterInvoker同时使用Directory和Invoker,二者相互隐式引用,维护和扩展代码都容易出问题,建议重构一下:
   1. MockClusterInvoker构造方法改为AbstractClusterInvoker类型参数,访问Directory通过AbstractClusterInvoker.getDirectory()方法;
   2. MockClusterWrapper构造方法入参类型改为AbstractCluster,join方法返回类型改为AbstractClusterInvoker<T>
   
   @chickenlj 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928979463






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928979463


   现在MockClusterInvoker同时使用Directory和Invoker,二者相互隐式引用,维护和扩展代码都容易出问题,
   ```
       @Override
       public boolean isDestroyed() {
           return directory.isDestroyed();  <== 1
       }
       ...
       @Override
       public void destroy() {
           this.invoker.destroy(); <== 2
       }
   ```
   建议重构一下:
   1. MockClusterInvoker构造方法两入参改为单入参AbstractClusterInvoker,通过AbstractClusterInvoker.getDirectory()访问Directory;
   2. MockClusterWrapper的join方法返回类型改为AbstractClusterInvoker<T>。
   
   @chickenlj 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927108077


   ```
   		ZookeeperRegistry(FailbackRegistry).unsubscribe(URL, NotifyListener) line: 329	
   		ListenerRegistryWrapper.unsubscribe(URL, NotifyListener) line: 129	
   		RegistryDirectory<T>(DynamicDirectory<T>).destroy() line: 241	
   		FailoverClusterInvoker<T>(AbstractClusterInvoker<T>).destroy() line: 112	
   		AbstractCluster$InterceptorInvokerNode<T>.destroy() line: 118	
   		MockClusterInvoker<T>.destroy() line: 78	
   		MigrationInvoker<T>.destroy() line: 192	
   		MigrationInvoker<T>(Invoker<T>).destroyAll() line: 50	
   		CommuLink.close() line: 44	
   		CommuLink.main(String[]) line: 66
   ```
   虽然上面是zk的解除注册过程,nacos应该也是如此,可能MockClusterInvoker.java和DynamicDirectory.java 并不需要修改。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925735497


   这里直接中文表述吧


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-928924025


   1. InterfaceCompatibleRegistryProtocol的getInvoker方法先创建Directory,再将其作为参数去创建ClusterInvoker,从逻辑上看销毁ClusterInvoker的Directory的职责应该是ClusterInvoker的destroy方法。
   2. MockClusterInvoker既设计了Directory成员,也设计了invoker成员,并且invoker接口没有提供getDirectory的方法,从设计角度看,可以扩展RegistryProtocol协议让不同的invoker共享同一个Directory,类似ReferenceCountExchangeClient那样。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-925743542


   for 1, n do
   instance = ReferenceConfig.get();
   call instance.func() success();
   ReferenceConfig.getInvoker().destroyAll();  <== 加一个这个试试原生的2.7.14还有没有资源泄露
   ReferenceConfig.destroy();
   end


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #8895: #8872 transfer layer session no close

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #8895:
URL: https://github.com/apache/dubbo/issues/8895#issuecomment-927102007


   > 你是对的 nacos没实现 unsub 所以才有问题2 #8907 这个问题2修复我已经提交了
   
   看到了,NacosRegistry的doUnsubscribe方法没有解除订阅的原因是NacosNamingServiceWrapper没有unsubscribe方法。
   
   nacos我们也在用,当初以为和阿里自己的configserver差不太多,但是现实和理想还是有很大距离的,nacos单中心部署没啥毛病,应用规模大了、要多中心部署了你可能就会遇到很多坑,这些问题全部指望社区解决不太现实,有实力就自己动手,没有实力就需要提前想其他办法了,推荐去github找一下蚂蚁金服的SOFARegistry,和nacos的功能对比一下看看,怎么说呢,感觉SOFARegistry和configServer更类似。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org