Aias00 opened a new issue, #6801:
URL: https://github.com/apache/shenyu/issues/6801
- severity: Medium
- files:
`shenyu-plugin-ai/shenyu-plugin-ai-token-limiter/.../AiTokenLimiterPlugin.java:268`
(inside `appendResponse`'s `doOnNext`, per data buffer chunk of a streaming
response)
- description: `String.split("\\r?\\n")` runs `Pattern.compile` per chunk;
SSE streams emit many chunks per response. (Sibling `COMPLETION_TOKENS_PATTERN`
at `:79` and `MAPPER` at `:196` are correctly precompiled.)
- impact: Per-chunk regex compilation on streaming AI responses.
- suggested_fix: Precompile `private static final Pattern SSE_LINE =
Pattern.compile("\\r?\\n");`.
- 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]