You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by zr...@apache.org on 2025/12/30 06:05:00 UTC
(dubbo) branch 3.3 updated: Call ByteBuf#release method before garbage collecting (#15917)
This is an automated email from the ASF dual-hosted git repository.
zrlw pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.3 by this push:
new 6a70f6b217 Call ByteBuf#release method before garbage collecting (#15917)
6a70f6b217 is described below
commit 6a70f6b217781fc35cc65bb464eb611512d91a3d
Author: qxggg <90...@users.noreply.github.com>
AuthorDate: Tue Dec 30 14:04:53 2025 +0800
Call ByteBuf#release method before garbage collecting (#15917)
---
.../apache/dubbo/remoting/http12/netty4/h1/NettyHttp1Channel.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/netty4/h1/NettyHttp1Channel.java b/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/netty4/h1/NettyHttp1Channel.java
index 19d0c807d0..58e28bb629 100644
--- a/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/netty4/h1/NettyHttp1Channel.java
+++ b/dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/netty4/h1/NettyHttp1Channel.java
@@ -28,6 +28,7 @@ import java.net.SocketAddress;
import java.util.concurrent.CompletableFuture;
import io.netty.channel.Channel;
+import io.netty.channel.ChannelFuture;
public class NettyHttp1Channel implements HttpChannel {
@@ -50,7 +51,12 @@ public class NettyHttp1Channel implements HttpChannel {
@Override
public CompletableFuture<Void> writeMessage(HttpOutputMessage httpOutputMessage) {
NettyHttpChannelFutureListener nettyHttpChannelFutureListener = new NettyHttpChannelFutureListener();
- this.channel.writeAndFlush(httpOutputMessage).addListener(nettyHttpChannelFutureListener);
+ this.channel.writeAndFlush(httpOutputMessage).addListener((ChannelFuture future) -> {
+ if (!future.isSuccess()) {
+ httpOutputMessage.close();
+ }
+ nettyHttpChannelFutureListener.operationComplete(future);
+ });
return nettyHttpChannelFutureListener;
}