-
Notifications
You must be signed in to change notification settings - Fork 8.1k
sentinel-dashboard并发下流控规则丢失问题 #1346
Copy link
Copy link
Open
Labels
area/dashboardIssues or PRs about Sentinel DashboardIssues or PRs about Sentinel Dashboardgood first issueGood for newcomersGood for newcomerskind/bugCategory issues or prs related to bug.Category issues or prs related to bug.
Metadata
Metadata
Assignees
Labels
area/dashboardIssues or PRs about Sentinel DashboardIssues or PRs about Sentinel Dashboardgood first issueGood for newcomersGood for newcomerskind/bugCategory issues or prs related to bug.Category issues or prs related to bug.
Type
Fields
Give feedbackNo fields configured for issues without a type.
多人同时操作流控规则查询和添加时有概率出现规则丢失的情况。配置中心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_丢失。