Aias00 opened a new issue, #6670: URL: https://github.com/apache/shenyu/issues/6670
- severity: High - files: `shenyu-plugin-ai/shenyu-plugin-ai-response-transformer/.../AiResponseTransformerPlugin.java:220` (`new ObjectMapper().readTree(body)` inside `extractJsonBodyFromAiResponse`, per response) and `:337` (`ObjectMapper objectMapper = new ObjectMapper()` inside `writeWith`'s `flatMap`, per response) - description: `writeWith` runs on every decorated response body when the ai-response-transformer plugin is active; `new ObjectMapper()` builds a fresh TypeFactory/SerializerProvider each call. Sibling `AiTokenLimiterPlugin.java:196` correctly hoists a static `MAPPER`. - impact: Per-response ObjectMapper construction on every AI-transformed response; CPU + young-gen pressure under load. - suggested_fix: Hoist `private static final ObjectMapper MAPPER = new ObjectMapper();` (reuse sibling pattern). - confidence: High - related_existing: PERF-22 covers `McpServerPlugin.java:710` + `MessageHandlingResult.java:93`; these are different files/classes. --- _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]
