Aias00 commented on PR #6914:
URL: https://github.com/apache/shenyu/pull/6914#issuecomment-5288909386

   Two optional, non-blocking suggestions
   Test coverage of the empty-rule branch: in the test, emptyRuleData is built 
with .selectorId(mockSelectorId1), so it is actually removed by 
removeRuleDataBySelector before removeEmptyRuleData ever applies — the 
removeEmptyRuleData path is not independently exercised. The real empty 
sentinel cached by AbstractShenyuPlugin.defaultMatchRule has no selectorId:
   
   RuleData emptyRuleData = RuleData.builder().pluginName(named()).build();
   Consider dropping .selectorId(...) from emptyRuleData (or using an unrelated 
selector id) so the empty-entry cleanup is covered precisely.
   Side observation (out of scope for this PR): since the trie cache removal in 
#6303, positive L1 match-cache hits are no longer used by 
AbstractShenyuPlugin.execute — a non-empty cached selector/rule is fetched but 
then immediately overwritten by defaultMatchSelector/defaultMatchRule; only the 
empty (null-id) sentinel short-circuits. So on current master the stale-routing 
window from this bug is limited, and this fix is mainly about memory hygiene, 
consistency with the update path, and future-proofing if the positive L1 
short-circuit is ever restored. That unused positive L1 cache may be worth a 
separate issue.


-- 
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