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/10/21 11:59:28 UTC

[GitHub] [dubbo] gqgq0311 opened a new issue #9094: dubbo关闭流程问题

gqgq0311 opened a new issue #9094:
URL: https://github.com/apache/dubbo/issues/9094


   dubbo在关闭的时候 可能会造成服务响应报错和自身调用错误 
   dubbo关闭流程在这个类中 DubboShutdownHook.destroyAll 2.6.11版本
   1 AbstractRegistryFactory.destroyAll();//函数会关闭注册中 下掉自身的注册 然后立刻进行
   2 protocol.destroy();//关闭对外服务server 和client
   当A节点执行完步骤2后 B节点尚未接收到注册中心的通知,
   这时B节点还可能访问A节点,此时A的服务已关闭导致B报错/重试
   
   所以关闭流程需要改为如下方案
   1 节点先关闭自身的注册(仅unregister),但是同时还保持监听其他节点变化的通知
   2 等待一定时间,防止其他节点接收注册中心通知慢
   3 关闭所有Protocol的server
   4 等待一定时间,防止内部还有自动任务/线程等其他操作还需要使用rpc调用其他节点
   5 关闭所有Protocol的client
   6 关闭注册中心的节点变化监听
   
   这样可以保证关闭流程中尽量减少其他节点调用错误的情况和保证服务本身可用优雅关闭
   其中3,4,5步骤可以合一
   2,4步骤建议可以配置或者提供接口,支持使用者实现接口进行流程阻塞等待
   
   


-- 
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] xiaoduanayu commented on issue #9094: dubbo关闭流程问题

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


   最新版本的dubbo关闭流程大体上有你说的这些改进,你可以关注下。


-- 
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