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

   ## Description
   `getHeaders` runs on the request thread: 
`headers.entrySet().stream().collect(Collectors.toMap(...))` (HashMap), 
`String.join(",", entry.getValue())` per header, then `JsonUtils.toJson(map)` 
(Gson reflection) per request. The downstream `LogCollector.collect` is async 
(buffer queue), but the header capture/JSON is synchronous on the request path.
   
   ## Location
   ```
   shenyu-plugin-logging-common/.../utils/LogCollectUtils.java:56-60 (from 
AbstractLoggingPlugin.java:108)
   ```
   
   ## Impact
   Blocking CPU serialization on the Netty event loop for every logged request; 
non-trivial for requests with many headers.
   
   ## Suggested fix
   Defer serialization to the consumer thread (enqueue the raw `HttpHeaders` 
reference and serialize in `AbstractLogCollector.consume`), or cache a 
precomputed header-name allowlist.
   
   ## Related existing issue(s)
   #6512 (gzip per chunk) and #6511 (desensitization leak) are different 
defects in the logging plugin.
   
   _Identified during the 2026-08-02 audit; full list in 
[`docs/issue-candidates-2026-08-02.md`](docs/issue-candidates-2026-08-02.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