zrlw commented on code in PR #15518:
URL: https://github.com/apache/dubbo/pull/15518#discussion_r2182353870
##########
dubbo-remoting/dubbo-remoting-http3/src/main/java/org/apache/dubbo/remoting/http3/netty4/NettyHttp3FrameCodec.java:
##########
@@ -95,7 +96,11 @@ public void write(ChannelHandlerContext ctx, Object msg,
ChannelPromise promise)
new
DefaultHttp3HeadersFrame(((NettyHttpHeaders<Http3Headers>)
headers.headers()).getHeaders()),
promise);
if (headers.isEndStream()) {
- ctx.close();
+ if (promise.isDone()) {
Review Comment:
refer to io.netty.handler.codec.http2.Http2ConnectionHandler:
if the close operation causes the stream to be closed, it will add a hook to
close the channel after the given future completes whether executing
closeStreamLocal or closeStreamRemote method.
```
@Override
public void closeStream(final Http2Stream stream, ChannelFuture future) {
if (future.isDone()) {
doCloseStream(stream, future);
} else {
future.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) {
doCloseStream(stream, future);
}
});
}
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]