You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/02 12:11:20 UTC
[I] [BUG] WebClientPlugin: wasted/duplicate request-header copy + ineffective request-side dedup [shenyu]
Aias00 opened a new issue, #6572:
URL: https://github.com/apache/shenyu/issues/6572
## Description
Per proxied request: line 62 builds `new HttpHeaders(request.getHeaders())` (full copy) and applies `duplicateHeaders(...)` on it, but the line 67 `.headers(...)` lambda re-reads `exchange.getRequest().getHeaders()` and `addAll`s the raw, un-deduplicated request headers — the deduplicated `httpHeaders` from line 62 is never wired into the outbound request. So the request-side dedup is ineffective AND there's a wasted full `HttpHeaders` copy per request. The response side (97-100) also builds an intermediate `HttpHeaders` then `putAll`s into the exchange response (a second copy).
## Location
```
shenyu-plugin-httpclient/.../WebClientPlugin.java:62-67 (request side), 97-100 (response side)
```
## Impact
~4 `LinkedHashMap`-backed `HttpHeaders` allocations + ~40 entry re-insertions per request (for ~10 headers). Single most impactful GC fix on the proxy hot path; also a latent correctness concern (request-side `REQ_UNIQUE_HEADER` dedup has no effect).
## Suggested fix
Pass the line-62 `httpHeaders` into the lambda instead of re-reading `exchange.getRequest().getHeaders()`; for the response, write directly into `exchange.getResponse().getHeaders()` instead of allocating an intermediate `HttpHeaders`.
## Related existing issue(s)
None
_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: notifications-unsubscribe@shenyu.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] WebClientPlugin: wasted/duplicate request-header copy + ineffective request-side dedup [shenyu]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed issue #6572: [BUG] WebClientPlugin: wasted/duplicate request-header copy + ineffective request-side dedup
URL: https://github.com/apache/shenyu/issues/6572
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] WebClientPlugin: wasted/duplicate request-header copy + ineffective request-side dedup [shenyu]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6572:
URL: https://github.com/apache/shenyu/issues/6572#issuecomment-5157757713
👋 Hello @yuluo-yx
A new issue has been opened by @Aias00:
- **Title**: [BUG] WebClientPlugin: wasted/duplicate request-header copy + ineffective request-side dedup
- **Link**: https://github.com/apache/shenyu/issues/6572
Please review when you have time. Thank you! 🙏
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org