You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2021/03/23 02:39:14 UTC

[dubbo] branch master updated: Fix channel reconnect (#7322)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new cd1d30f  Fix channel reconnect (#7322)
cd1d30f is described below

commit cd1d30ffa07f8764598fa1078d3d7f06c0ee277d
Author: ken.lj <ke...@gmail.com>
AuthorDate: Tue Mar 23 10:38:42 2021 +0800

    Fix channel reconnect (#7322)
---
 .../dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java
index 8c4d07b..22b99ea 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java
@@ -29,7 +29,6 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import static org.apache.dubbo.remoting.Constants.RECONNECT_KEY;
 import static org.apache.dubbo.remoting.Constants.SEND_RECONNECT_KEY;
 import static org.apache.dubbo.rpc.protocol.dubbo.Constants.LAZY_CONNECT_INITIAL_STATE_KEY;
 
@@ -181,7 +180,7 @@ final class ReferenceCountExchangeClient implements ExchangeClient {
     private void replaceWithLazyClient() {
         // this is a defensive operation to avoid client is closed by accident, the initial state of the client is false
         URL lazyUrl = url.addParameter(LAZY_CONNECT_INITIAL_STATE_KEY, Boolean.TRUE)
-                .addParameter(RECONNECT_KEY, Boolean.FALSE)
+                //.addParameter(RECONNECT_KEY, Boolean.FALSE)
                 .addParameter(SEND_RECONNECT_KEY, Boolean.TRUE.toString())
                 .addParameter(LazyConnectExchangeClient.REQUEST_WITH_WARNING_KEY, true);
 
@@ -204,5 +203,9 @@ final class ReferenceCountExchangeClient implements ExchangeClient {
     public void incrementAndGetCount() {
         referenceCount.incrementAndGet();
     }
+
+    public int getCount(){
+        return referenceCount.get();
+    }
 }