Repository navigation
[ISSUE #8223] Publish opt-in read-only base configuration - #8351
hanzhe-one wants to merge 2 commits into
Conversation
|
Keeping this as a Draft deliberately. Before I spend time producing the full performance matrix, I would like scope feedback — if the direction is wrong, adjusting now is cheaper than after the benchmark work. What this slice does
What it deliberately does not do
Validation so far174 targeted tests pass, covering DTO snapshot/equality/JSON compatibility, publication isolation including nested conditions and map/list entry writes, rejection of invalid input without a partial channel update, invalidation, the legacy plugin path, and real Divide matching/forwarding with request-owned default rules. Checkstyle reports 0 violations; RAT is clean on the three affected modules. The comparison harness compiles against both the The gate that is not metThe issue's real-forwarding performance acceptance gate is unmet. On this machine a standalone probe fails before any gateway code runs:
So throughput, p95/p99, CPU, allocation, update convergence and retained-memory numbers are missing, and I am not claiming the absence of a regression. Questions
|
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
PR #8351 (head 53ed802) implements the first slice of opt-in read-only base configuration publishing, with Divide as an adopter. Changed files include new DtoSnapshots (freeze/read-only snapshots), BaseDataCache/ReadMatchDataCache PUBLISHED+READ_ONLY singletons, DividePlugin and AbstractShenyuPlugin wiring, plus docs and tests. The PR description itself states it is Draft and the real-forwarding performance acceptance gate is unmet.
Evidence
- Frozen reference: ci.complete=true, ci.passed=false, ci.legacy_state=pending, 64 checks; PR description marks it Draft with unmet performance gate
- resource_read BaseDataCache.java@head: INSTANCE/PUBLISHED/READ_ONLY singletons; published flag gates writes to PUBLISHED; cacheRuleData uses DtoSnapshots.freeze when published
- resource_read MatchDataCache.java@head: PUBLISHED/READ_ONLY singletons and readOnly() accessor added; remove/cache methods propagate to PUBLISHED only from INSTANCE
Recommended next steps
- Re-read the pinned diff via resource_diff from offset 161000 until has_more=false to cover the remaining ~4281 characters and all 18 files
- Reconcile CI status: provided evidence shows complete=true but passed=false; obtain green CI before any PASS
- Verify DividePlugin and AbstractShenyuPlugin integration against the read-only cache contract and the new tests
Scope: captured diff and GitHub check metadata only; no local tests were executed.
Task: 4af48a03-91a9-4f46-b92f-a36f5ed086fe · Commit: 53ed8024e357780d1ce0ce543bccefcd43695e5f
Review verdict: INCONCLUSIVE
Full diff coverage was not achieved (next_unread_offset 161000 of 165281; diff pages archived and not re-materialized in context) and the provided CI evidence reports passed=false, so PASS cannot be granted and no concrete blocking defect was confirmed in the partial read. Per protocol, incomplete coverage and non-passing CI yield INCONCLUSIVE with empty reviewed_head and no findings.
Publication: COMMENT (REVIEW_EVIDENCE_MISSING)
Review details
Review could not be completed to a PASS/NEEDS_CHANGES verdict. Per the frozen reference evidence, the diff was not fully read (next_unread_offset 161000 of total 165281 characters; full diff pages were archived and not re-materialized in this context), and CI is reported complete=true but passed=false with legacy_state=pending. Partial source reads of BaseDataCache, MatchDataCache and DtoSnapshots confirm the read-only snapshot design (PUBLISHED/READ_ONLY instances, freeze() gating), but full cross-file contract verification and all 18 changed files were not covered. Recommend re-running the review after retrieving the remaining diff pages and confirming green CI; the PR should remain Draft until the performance gate is satisfied.
|
Could a maintainer please rerun only the failed I checked the full job log:
This is consistent with a transient request/connection delay, but the root cause is not established and I am not claiming it is unrelated to this PR. A rerun of the unchanged job would help distinguish a repeatable regression from a one-off timeout. If it repeats, I will investigate further rather than adding retries or weakening the test. I tried The PR remains Draft: green CI would not replace the separately outstanding real-forwarding performance acceptance gate. |
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
Reviewed the full 18-file PR that adds opt-in frozen BaseDataCache configuration views (DtoSnapshots, dual legacy/published channels, readOnly contracts, DividePlugin opt-in) together with benchmark harness and tests. No concrete production defect was found, but CI is pending and the documented performance/publication-visibility gate is unmet, so the verdict is INCONCLUSIVE.
Evidence: ["Full VERSIONED_DIFF read to completion: all pages offset 0..165817, has_more=false, each sha256 6dcf797c24faad9ac03a0f3f04361ebb5d447dae8aa3775e85ab0441ddefd687 matching the pinned comparison; 18 files spanning DTOs, cache/matching classes, DividePlugin, benchmark docs and new tests.","CI evidence shows all 44 checks in_progress with null conclusions, passed=false, pending=true, diagnosis CI_PENDING; no passing CI is available on the reviewed head.","PR description states performance parity is inconclusive, the full update matrix failed 'IllegalStateException: first post-publication request must see v32' in the baseline variant, and the required real-forwarding acceptance gate/public artifacts remain outstanding. Verified at pinned head that DividePlugin.doExecute only reads selector/rule and that subscriber invalidations forward to the published channel; no concrete HIGH/CRITICAL defect identified."]
Next steps: ["Wait for the pending CI checks on head 98bdd5f (notably build and shenyu-integrated-test-http) to complete and confirm they pass.","Obtain the outstanding real-forwarding performance evidence, a successful full update/correctness matrix (the baseline 'first post-publication request must see v32' assertion failure), and reproducible public artifacts required by issue #8223.","Re-run the review once CI and validation evidence are complete to reach a PASS or a defect-anchored NEEDS_CHANGES conclusion."]
Verdict: INCONCLUSIVE; publication: COMMENT (DIFF_DELIVERY_INCOMPLETE)
Findings: []
Scope: captured GitHub evidence only; no local tests were executed.
Task: 20563cc3-010e-45fa-bbd4-6d0d6529b5f6 Commit: 98bdd5f22b5783ad0a27477feb491c7e575644d3
Refs #8223.
Review scope and outstanding merge gate
This is the BaseDataCache matching-configuration first slice, with Divide as an actual adopter. It does not close #8223 or claim all gateway/Divide configuration is immutable. MetaDataCache, CommonHandleCache and parsed Divide handles remain explicitly documented legacy mutable paths.
Ready for review at the author's request; not a claim that the performance/merge gate has passed. Cloud-host validation now runs successfully, but performance parity remains inconclusive and the full update matrix encountered a baseline cache-hit publication-visibility assertion failure. Please review the implementation and the limitations below; the performance acceptance item remains unchecked. The earlier local Selector/loopback failure is not a blocker on the cloud host.
Problem and evidence
List.copyOf prevents changing the selector/rule container but does not detach its mutable DTO elements or nested conditions. A caller retaining the source ConditionData can alter another request's effective matching configuration.
An isolated probe compiled the production BaseDataCache from base 548bec1, published a selector with
/original, modified its source condition to/polluted, and checked the returned value:/polluted, assertion fails (exit 1).readOnly()contract:/original, assertion passes (exit 0).The same mutation is covered in PublishedConfigurationTest, including a legacy positive control showing that an immutable list alone is insufficient. This is a same-JVM trusted-code correctness boundary, not an HTTP mutation primitive or a sandbox against malicious extensions.
Changes
Compatibility and related work
Legacy mutable getter/map APIs remain, but direct writes to those maps are not publication to adopted plugins. Extensions must use the normal subscriber/publication APIs and standard DTOs before opting in. The compatibility period retains two representations and separate bounded derived-match caches, which adds update/storage cost that must be measured.
Frozen objects do not establish multi-object consistency or remove existing stale-match races. #8060 owns transactional revisions; #8061 owns resource leases. Existing match-cache generation/selector-scoping work in PR #7681 and PR #8103, and matching observation in PR #8291, is not duplicated here. The paired writer monitor exists to avoid introducing opposite legacy/frozen update orders; it is not a substitute for their request-visible contracts.
Validation
Targeted Maven-wrapper reactor command:
./mvnw -o -Dmaven.legacyLocalRepo=true -pl shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-divide -am test -Dtest=DtoSnapshotsTest,PluginDataTest,SelectorDataTest,RuleDataTest,ConditionDataTest,PublishedConfigurationTest,BaseDataCacheTest,MatchDataCacheTest,AbstractShenyuPluginTest,CommonPluginDataSubscriberTest,DividePluginTest,DividePublishedConfigurationTest -Dsurefire.failIfNoSpecifiedTests=false -Djacoco.skip=true -Dmaven.javadoc.skip=true174 tests, 0 failures, 0 errors, 0 skipped:
Coverage includes source/nested-condition detachment; reflective coverage of every public setter and DTO field; symmetric equality and Gson/Jackson round trips; map/list/entry mutation rejection; legacy-map isolation; refresh ordering and removal; rejection of invalid snapshots without partial channel updates; held-reader stability; read-only match injection rejection; actual Divide matching/forwarding, positive/negative invalidation and request-local default rules; live health/inflight mutation.
./mvnw -o -Dmaven.legacyLocalRepo=true -pl shenyu-common,shenyu-plugin/shenyu-plugin-base,shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-divide apache-rat:check: passed, 0 unapproved files in all three modules.git diff --checkand staged diff check: passed.javac --release 17: passed against changed and baseline APIs; the nine base override classes also compiled. PowerShell AST parsing: passed. These checks used available local/installed dependencies, not a completed benchmark deployment; the standard gateway-classpath.txt was absent. Only compilation/static validity is claimed.Cloud-host validation update (2026-11-08)
All project compilation, tests and benchmark execution reported here took place on the Simular Box cloud computer, not the phone. Tested PR head:
53ed8024e357780d1ce0ce543bccefcd43695e5f; benchmark baseline override:548bec1f9. Ubuntu x86_64, Java 17.0.20.1, Maven Wrapper 3.6.3; system-visible 4 logical CPUs and approximately 7.7 GiB RAM. Benchmark JVMs used the runner's 512 MiB heap and ActiveProcessorCount=8; the latter is a runner setting, not a claim of 8 physical cores.Observed latency (median of three sample p95 values, milliseconds)
Interpretation: inconclusive, not a performance pass. Some 500-rps samples show substantial apparent regressions, while lower-rate comparisons change direction and remain noisy. Allocation per request was broadly similar, but latency/CPU variability prevents a defensible no-regression or capacity-parity claim. Fixed offered-rate runs do not establish saturation throughput. JFR was collected; a complete profiling/retained-memory and saturation analysis is still outstanding.
Failed update-matrix evidence (not waived)
The original full 500-rps matrix recorded 30 completed samples with 0 recorded load-request errors, then failed at
baseline-1-cache-hit-b32-r500-0:IllegalStateException: first post-publication request must see v32. The load process subsequently remained alive until the runner's 180-second deadline. This is a correctness assertion failure despite zero errors in preceding completed samples. It occurred in the baseline variant; this alone does not establish that the change is unaffected or fixes it. Further baseline/change reproduction, cache invalidation/concurrent repopulation investigation, and harness failure-path cleanup are required. No claim of publication-convergence acceptance is made.Raw CSV, per-process logs, configurations and JFR files are retained on the cloud host under
/workspace/shenyu-pr8351/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-divide/target/config-views-*:config-views-20261108-103438-33f0c05d.config-views-20261108-104707-832b7eaa./workspace/pr8351-steady100.logand.exit; its timestamped directory remains under the same target parent.These paths are provenance on the test host, not publicly attached artifacts or independently downloadable evidence. Publishing a reproducible artifact bundle remains outstanding.
Not run / still required: full repository clean install; Docker/e2e; successful full update/correctness matrix; resolved performance variability and regression assessment; saturation/rate sweep; complete CPU/allocation/peak/retained-memory/JFR analysis; public raw artifacts and reproducible Linux runner. Earlier compile-only limitations above describe the original submission environment and are superseded only by the specific cloud-host checks listed here.
Checklist
./mvnw clean install -Dmaven.javadoc.skip=truepassed (not run; targeted checks above).