-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When use nacos as sync center. When a rule is deleted, the corresponding cache in Bootstrap is not synchronously removed, leading to the path still being callable.
1、add an selector and rule

2、call the interface, can obtain the correct response
3、delete the rule. the rule list is empty, as below picture.
4、call the interface again, can still obtain the correct response instead of "divide:Rule not found!".
Expected Behavior
After deleting the rule, re-requesting the interface will result in “{"code":-102,"message":"divide:Rule not found!"}”
Steps To Reproduce
- check out to master branch and pull the lastest code.
- use nacos as data sync center.
- add one rule in a selector.
- delete the rule.
Environment
ShenYu version(s):branch master latest, tag v2.7.0Debug logs
No response
Anything else?
When a rule is deleted, the bootstrap will observe the dynamic configuration key deleted by Nacos, and then parse out the selectorId and ruleId from the key, and finally remove the corresponding ruleId from the RULE_MAP cache. During the parsing of the Nacos key, the selectorId and ruleId were set to incorrect values.
As result the corresponding rule cache for the selectorId and ruleId could not be found when removeRuleData in RULE_MAP.




