Aias00 opened a new issue, #6798:
URL: https://github.com/apache/shenyu/issues/6798

   - severity: Medium-High
   - files: 
`shenyu-plugin-.../apache-dubbo/.../cache/ApacheDubboConfigCache.java:531-536` 
(`invalidateWithSelectorId`), `:543-548` (`invalidateWithRuleId`), `:555-560` 
(`invalidateWithMetadataId`); 
`.../sofa/.../cache/ApplicationConfigCache.java:436-467`
   - description: Cache keys are composite 
`namespace_selectorId_ruleId_metaDataId_protocol_<md5(registry)>_version_group`.
 Invalidation matches `key.contains(id)` as a *substring*; a short numeric/UUID 
id (or common hex chars in the md5 segment) can legitimately match unrelated 
keys. Each spurious invalidation triggers `cache.invalidate` → 
`removalListener` → `config.destroy()`, so the next request forces a full 
`reference.get()`/`refer()` rebuild (expensive registry connect) on the request 
hot path. Worst case (id `1`, `0`) → mass invalidation. Also an O(n) full scan 
of `cache.asMap().keySet()` on every sync event.
   - impact: Sync event → request hot-path rebuild storm; event-loop stalls 
during registry reconnect (see PERF-51).
   - suggested_fix: Invalidate by exact composite-key segment (split key on 
separator and compare the specific segment), or maintain a secondary index `id 
-> Set<cacheKey>` for O(1) exact invalidation.
   - confidence: High
   
   ---
   _Identified during the 2026-08-02 deep re-scan; full list in 
[`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.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]

Reply via email to