Skip to content

fix(plugin): scope rule match cache to selectors - #8103

Open
yangjj-iso wants to merge 5 commits into
apache:masterfrom
yangjj-iso:feat/7976-selector-scoped-rule-cache
Open

yangjj-iso wants to merge 5 commits into
apache:masterfrom
yangjj-iso:feat/7976-selector-scoped-rule-cache

Conversation

@yangjj-iso

@yangjj-iso yangjj-iso commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

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.

@yangjj-iso
yangjj-iso marked this pull request as ready for review November 1, 2026 23:22
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 Aias00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Rule match cache reuses a rule from another selector for the same request path

2 participants