alibaba / alibaba/Sentinel

sentinel-dashboard并发下流控规则丢失问题

Open
#1,346 11 comments 0 reactions 1 assignee Claimed by @PeineLiang View on GitHub
area/dashboard good first issue kind/bug
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

多人同时操作流控规则查询和添加时有概率出现规则丢失的情况。配置中心Apollo
1.apiQueryMachineRules查询操作分为几步
a.从配置中心Apollo获取规则
b.清空内存中appRules等信息
c.循环保存规则信息至内存appRules
d.返回规则列表
2.apiAddFlowRule添加操作分为几步
e.保存app规则至内存appRules,若该app无配置,则新建
f.推送内存appRules等信息到配置中心Apollo

多人并发操作情况下,假如某app已存在规则_X_、_Y_,添加_Z_规则时,有人访问控制台查询规则列表,并至b处,
这时添加操作开始执行至 e 处读取无配置并新建往里面塞入_Z_。然后推送只有Z的列表到Apollo保存。
此时两个操作执行结束后,_X_、_Y_丢失。

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.