Wweiei opened a new issue, #5928:
URL: https://github.com/apache/shenyu/issues/5928

   ### Is there an existing issue for this?
   
   - [x] 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
   
   
![Image](https://github.com/user-attachments/assets/8a4627c9-bb33-487f-8bee-1f5d3d51b86f)
   2、call the interface, can obtain the correct response
   
   
![Image](https://github.com/user-attachments/assets/2bfe1ad4-af12-439f-8501-59762aa6fb21)
   
   3、delete the rule. the rule list is empty, as below picture.
   
   
![Image](https://github.com/user-attachments/assets/b2010e1c-9adc-4f12-955c-9f1d9a424617)
   
   4、call the interface again, can still obtain the correct response instead of 
"divide:Rule not found!".
   
   
![Image](https://github.com/user-attachments/assets/3fd16f1d-cd42-4537-ac6b-7518bcddb07d)
   
   ### Expected Behavior
   
   After deleting the rule, re-requesting the interface will result in 
“{"code":-102,"message":"divide:Rule not found!"}”
   
   ### Steps To Reproduce
   
   1. check out to master branch and pull the lastest code.
   2. use nacos as data sync center.
   3. add one rule in a selector.
   4. delete the rule.
   
   ### Environment
   
   ```markdown
   ShenYu version(s):branch master latest, tag v2.7.0
   ```
   
   ### Debug 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. 
   
   
![Image](https://github.com/user-attachments/assets/4dd39257-fd86-4edc-a86d-42eb18eacbd8)
   
   As result the corresponding rule cache for the selectorId and ruleId could 
not be found when removeRuleData in RULE_MAP. 
   
   
![Image](https://github.com/user-attachments/assets/bff4948e-70c3-4ed6-a7dd-d16a329c259f)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to