You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by ea...@apache.org on 2023/04/05 10:43:25 UTC

[dubbo] branch 3.2 updated: fix the bug of reconnect (#12019)

This is an automated email from the ASF dual-hosted git repository.

earthchen pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.2 by this push:
     new fe03f26be4 fix the bug of reconnect (#12019)
fe03f26be4 is described below

commit fe03f26be428b18009c92ffe535413fe2a9bf676
Author: icodening <cl...@gmail.com>
AuthorDate: Wed Apr 5 18:43:16 2023 +0800

    fix the bug of reconnect (#12019)
---
 .../dubbo/remoting/transport/netty4/NettyConnectionHandler.java       | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionHandler.java b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionHandler.java
index 926110373b..3ab6fbc8fc 100644
--- a/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionHandler.java
+++ b/dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionHandler.java
@@ -77,6 +77,10 @@ public class NettyConnectionHandler extends ChannelInboundHandlerAdapter impleme
             LOGGER.debug(String.format("Connection %s is reconnecting, attempt=%d", connectionClient, 1));
         }
         final EventLoop eventLoop = nettyChannel.eventLoop();
+        if (connectionClient.isClosed()) {
+            LOGGER.info("The client has been closed and will not reconnect. ");
+            return;
+        }
         eventLoop.schedule(() -> {
             try {
                 connectionClient.doConnect();