YoungHu opened a new issue, #12887:
URL: https://github.com/apache/dubbo/issues/12887

   <!-- If you need to report a security issue please visit 
https://github.com/apache/dubbo/security/policy -->
   
   - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) 
of this repository and believe that this is not a duplicate.
   
   ### Bug description
   3.0.12版本为修复一些问题,接口级订阅的时候增加一个带冒号和不带冒号实例合并的逻辑。
   
![image](https://github.com/apache/dubbo/assets/7418602/c25bdd07-4967-468c-807f-d567d96f6134)
   
如果不带冒号的服务订阅事件通知下来,即使实例为0,按照下面的逻辑,会错误的更新实例信息和带冒号的一样。这个时候因为后面会做ip合并不会有问题,但是在容器环境下,所有节点重启后ip变了,不带冒号的又不会有通知就一直老的实例信息,最后合并出来的就是带有新+老的所有实例,然后导致失败的情况出现。
   
![image](https://github.com/apache/dubbo/assets/7418602/f46a935f-015b-42ed-bcb5-294eb0cc7a3b)
   
这是一个偶发问题,主要的原因是消费者订阅是先拉取实例信息,这个时候nacos异步产生的事件会在下面截图这里return掉,因为还没有执行registerLisenter,map为空。但是有个例外情况就是如果异步事件执行的非常慢,registerLisenter是会先执行完的,顺序点到后异步事件就能顺利的往下执行。引发我们上面说的问题。
   
![image](https://github.com/apache/dubbo/assets/7418602/d4e47b19-07a6-458f-bfda-b978b9b23f39)
   
![image](https://github.com/apache/dubbo/assets/7418602/7147d439-de63-489f-8099-bc597c1a1247)
   
   
   ### Environment
   
   * Dubbo version: 3.0.12
   * Operating System version: mac os, linux
   * Java version: JDK8
   
   ### Steps to reproduce this issue
   复现也比较简单
   1. 提供者启动3个pod节点
   2. 在onevent这里打线程级断点
   3. 本地启动消费者的应用
   4. 断点进来以后不用管,等待应用启动完成
   5. 释放断点继续执行完事件通知
   6. 销毁提供者的3个pod,重新新建3个,ip地址要求全换掉
   7. 看应用的日志,发现interface url size显示有6个。其中3个无法正常使用
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to