dubbo
dubbo copied to clipboard
接口级服务发现 本地缓存provider信息的cache文件与内存中的provider信息会出现不一致
AbstractRegistry.doSaveProperties()虽然采用文件锁、版本号以及重试等方式对竟争场景做了处理,但是在竟争文件锁失败创建重试任务时,没有sleep,仍会有概率出现上一个版本保存操作还没有释放锁,新版本重试次数达到上限导致新版本数据没有保存到cache文件的情况。
Environment
- Dubbo version: 3.05
- Java version: 1.8
Steps to reproduce this issue
- 延长AbstractRegistry.doSaveProperties() 中文件锁的持有时间
- 在consumer中创建多个DubboService的Reference
- 短时间内同行时修改DubboService 的Provider侧信息
Pls. provide [GitHub address] to reproduce this issue.
Expected Behavior
cache文件中的信息与consumer 应用内存中的Provider信息(AbstractRegistry.properties )一致
Actual Behavior
cache文件中的信息存在不致一、过时的情况,即比consumer 应用内存中的Provider信息(AbstractRegistry.properties )旧 该情况偶现
可以提个PR看怎么修复下
Please assign this issue to me
已提交PR,请帮忙审核下哈