Repository navigation
fix(plugin): scope rule match cache to selectors - #8103
yangjj-iso wants to merge 5 commits into
Conversation
# Conflicts: # shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/AbstractShenyuPlugin.java
Preserve selector/rule cache isolation and timed predicate behavior. Validation: 59 selected tests passed; Checkstyle and RAT passed across the 11-module Maven-wrapper reactor. Test JVM loads Byte Buddy agent explicitly because this runtime does not support dynamic self-attachment. Signed-off-by: redyyang <3202137046@qq.com>
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
Reviewed the complete FULL_DIFF for the selector-scoped rule-match cache change; no concrete HIGH/CRITICAL defect was found, but CI has not produced any results, so the verdict is inconclusive.
Evidence: ["FULL_DIFF attachment (complete_diff=true) covers all 6 changed files; every patch hunk in AbstractShenyuPlugin.java, MatchDataCache.java and the four tests was reviewed.","CI block: 11 checks all status=queued, conclusion=null, passed=false, pending=true, diagnosis=CI_PENDING.","Scoped key (selectorId.length()+':'+selectorId+path), negative-entry owner ID, and scoped get/put overloads are internally consistent with the updated tests; resource_list/read/search all failed, so full-file cross-contracts could not be independently read."]
Next steps: ["Wait for the 11 queued CI checks to finish and re-evaluate once results are available.","Verify cross-file invalidation contracts (removeRuleDataBySelector / removeRuleData against scoped and negative entries) when full source files are readable."]
Verdict: INCONCLUSIVE; publication: COMMENT (INCONCLUSIVE_REVIEW)
Findings: []
Scope: captured GitHub evidence only; no local tests were executed.
Task: 371c7e4c-7ef7-408f-a646-f471e22bc9fa Commit: 1a75498711fbd48c0adf5b63090eb74e373368ea
Fixes #7976.
Scope rule-match cache entries by plugin, the actual selected Selector ID and rewritten request path. A positive or negative entry warmed for Selector A cannot satisfy a request that selected B. Preserve the bounded map, TTL, legacy path-only API and invalidation operations; negative entries retain their owner ID for removal.
Updated against master 92d16c2. Retain the upstream all-candidate path-only eligibility checks for dynamic/time predicates. Update execution-path tests to inspect the scoped key, so the cache assertions cannot pass by reading an unused legacy key.
Validation on Java 17: 510 reactor tests passed, including all 365 plugin-base tests, positive/negative cache controls, dynamic-selector/rule eligibility, TTL and invalidation. Checkstyle, RAT and git diff --check passed.
This is a narrow alternative to open PR #7681, not an additional cache-generation redesign. Coordinate that choice before merge; no configuration-generation fencing or complete configuration-snapshot guarantee is claimed.