Skip to content

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

@wensuliang

Description

@wensuliang

多人同时操作流控规则查询和添加时有概率出现规则丢失的情况。配置中心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_丢失。

Metadata

Metadata

Assignees

Labels

area/dashboardIssues or PRs about Sentinel Dashboardgood first issueGood for newcomerskind/bugCategory issues or prs related to bug.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions