Aias00 opened a new issue, #6623: URL: https://github.com/apache/shenyu/issues/6623
- severity: High - files: `shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/ScaleRuleServiceImpl.java:107-115`; `shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/ScaleRuleDO.java:212-216` - description: In `create(...)`, `ScaleRuleDO.buildScaleRuleDO(scaleRuleDTO)` is called twice. `buildScaleRuleDO` generates a fresh `UUIDUtils.getInstance().generateShortUuid()` whenever the DTO id is blank (line 212-213). The first build (`scaleRuleDO`, line 107) gets UUID A and is inserted. The second build on line 112 runs on the same `scaleRuleDTO` whose `id` is STILL blank, so it generates a brand-new UUID B and stores that in `ScaleRuleCache`. - impact: The cache holds a phantom rule (UUID B) that does not correspond to any DB row (UUID A). Subsequent `removeRulesFromCache(ids)` keyed by the real DB id will not touch the phantom; the scaler may operate on a rule that does not exist, or ignore the real one. Cache/DB divergence. - suggested_fix: Reuse the inserted DO for the cache: `scaleRuleCache.addOrUpdateRuleToCache(scaleRuleDO);` (remove the second `buildScaleRuleDO` call). The same double-build pattern exists in `update` (line 128). - confidence: High - related_existing: none. --- _Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.md)._ -- 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]
