Aias00 commented on code in PR #7274:
URL: https://github.com/apache/shenyu/pull/7274#discussion_r4110064901
##########
shenyu-plugin/shenyu-plugin-response/src/main/java/org/apache/shenyu/plugin/response/strategy/WebClientMessageWriter.java:
##########
@@ -67,7 +67,10 @@ public class WebClientMessageWriter implements MessageWriter
{
@Override
public Mono<Void> writeWith(final ServerWebExchange exchange, final
ShenyuPluginChain chain) {
- return chain.execute(exchange).then(Mono.defer(() -> {
+ Mono<Void> chainResult = Mono.defer(() -> chain.execute(exchange))
+ .doOnError(error -> clean(exchange))
Review Comment:
Non-blocking: `clean()` calls `.map(DataBufferUtils::release).subscribe()`
with no error consumer, so if the body Flux tolerates only one subscriber and
this runs while the write phase is still active, the rejection surfaces as
`Operators.onErrorDropped` noise. `subscribe(released -> { }, error ->
LOG.debug("body already released", error))` would make that explicit instead of
relying on the dropped-error hook.
I also traced the "cancel arrives during writing" path and believe it is
safe: this `doOnCancel` sits on the chain stage, and once that stage terminates
Reactor does not deliver a cancel back to it, so the inner `doOnCancel` at line
88 is the one that fires for write-stage cancellation. If you know of a path
where both fire, a guard flag would settle it cheaply.
--
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]