dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

接口级服务发现 本地缓存provider信息的cache文件与内存中的provider信息会出现不一致

Open saleson opened this issue 2 years ago • 3 comments

AbstractRegistry.doSaveProperties()虽然采用文件锁、版本号以及重试等方式对竟争场景做了处理,但是在竟争文件锁失败创建重试任务时,没有sleep,仍会有概率出现上一个版本保存操作还没有释放锁,新版本重试次数达到上限导致新版本数据没有保存到cache文件的情况。

Environment

  • Dubbo version: 3.05
  • Java version: 1.8

Steps to reproduce this issue

  1. 延长AbstractRegistry.doSaveProperties() 中文件锁的持有时间
  2. 在consumer中创建多个DubboService的Reference
  3. 短时间内同行时修改DubboService 的Provider侧信息

Pls. provide [GitHub address] to reproduce this issue.

Expected Behavior

cache文件中的信息与consumer 应用内存中的Provider信息(AbstractRegistry.properties )一致

Actual Behavior

cache文件中的信息存在不致一、过时的情况,即比consumer 应用内存中的Provider信息(AbstractRegistry.properties )旧 该情况偶现

saleson avatar Aug 03 '22 08:08 saleson

可以提个PR看怎么修复下

AlbumenJ avatar Aug 04 '22 03:08 AlbumenJ

Please assign this issue to me

acmday avatar Aug 05 '22 01:08 acmday

已提交PR,请帮忙审核下哈

jk-tonycui avatar Aug 06 '22 14:08 jk-tonycui