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

   - severity: Medium-High
   - files: 
`shenyu-plugin/shenyu-plugin-response/src/main/java/org/apache/shenyu/plugin/response/strategy/WebClientMessageWriter.java:70`
   - description: The `ResponseEntity<Flux<DataBuffer>>` set into 
`CLIENT_RESPONSE_ATTR` by `WebClientPlugin` holds a lazy body Flux; the 
reactor-netty connection is not returned to the pool until that Flux is 
subscribed and drained/cancelled. `onErrorResume`/`doOnCancel` here only cover 
errors during `exchange.getResponse().writeWith(body)` (inside the `defer`); 
there is no guard on `chain.execute(exchange)` itself. If any plugin running 
*after* the WebClient call throws or the chain is cancelled, the `defer` is 
never reached, the body Flux is never subscribed, and the connection is held 
until the client idle/recv timeout. Sibling 
`NettyClientMessageWriter.java:59,82` correctly guards the same path with 
`doOnError`/`doOnCancel` → `cleanup(exchange)`.
   - impact: Leaked upstream connections (not returned to the 
WebClient/reactor-netty pool) on any mid-chain failure; pool starvation under 
sustained mid-chain failures.
   - suggested_fix: Add `.doOnError(e -> clean(exchange)).doOnCancel(() -> 
clean(exchange))` to `chain.execute(exchange)` at line 70, mirroring 
`NettyClientMessageWriter` (`clean` already drains/releases the body at line 
128).
   - confidence: Medium-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]

Reply via email to