Aias00 opened a new issue, #6648: URL: https://github.com/apache/shenyu/issues/6648
- severity: High - files: `shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-request-transformer/src/main/java/org/apache/shenyu/plugin/ai/transformer/request/cache/ChatClientCache.java:31`; `.../ai-response-transformer/.../cache/ChatClientCache.java:31` - description: Both caches back a shared singleton with `private static final Map<String, ChatClient> CHAT_CLIENT_MAP = new HashMap<>()` and expose `init`(put)/`getClient`(get)/`destroyClient`(remove). These are mutated from the sync-data thread and read from reactive request threads. `HashMap` is not safe for concurrent read/write: structural modifications during `get`/`put` can corrupt the table or loop indefinitely. The AI-proxy `ChatClientCache` correctly uses `ConcurrentHashMap`; these two do not. - impact: Lost/stale ChatClient entries, corrupted map structure, or stuck CPU under concurrent rule updates and traffic. - suggested_fix: Replace `new HashMap<>()` with `new ConcurrentHashMap<>()` in both caches. - confidence: High - related_existing: none — #6470/#6471 are about the AI-proxy plugin, not these transformer caches. --- _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]
