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 ed182c9960 Shutdown output after Ping frame is sent by 
Http3ClientFrameCodec (#15524)
ed182c9960 is described below

commit ed182c996072b40224cc3e0152de9a12c4ed629b
Author: zrlw <[email protected]>
AuthorDate: Mon Jul 7 10:59:20 2025 +0800

    Shutdown output after Ping frame is sent by Http3ClientFrameCodec (#15524)
---
 .../apache/dubbo/rpc/protocol/tri/h3/Http3ClientFrameCodec.java  | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h3/Http3ClientFrameCodec.java
 
b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h3/Http3ClientFrameCodec.java
index 82e41bd333..34adf25565 100644
--- 
a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h3/Http3ClientFrameCodec.java
+++ 
b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/h3/Http3ClientFrameCodec.java
@@ -158,8 +158,13 @@ public class Http3ClientFrameCodec extends 
ChannelDuplexHandler {
                         header.set(PseudoHeaderName.SCHEME.value(), 
HttpConstants.HTTPS);
                         header.set(Constants.TRI_PING, "0");
 
-                        streamChannel.write(new 
DefaultHttp3HeadersFrame(header));
-                        streamChannel.shutdownOutput();
+                        ChannelFuture pingSentFuture =
+                                streamChannel.write(new 
DefaultHttp3HeadersFrame(header), streamChannel.newPromise());
+                        if (pingSentFuture.isDone()) {
+                            streamChannel.shutdownOutput();
+                        } else {
+                            pingSentFuture.addListener((ChannelFutureListener) 
f -> streamChannel.shutdownOutput());
+                        }
                     } else {
                         LOGGER.warn(TRANSPORT_FAILED_RECONNECT, "Failed to 
send ping frame", future.cause());
                     }

Reply via email to