You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by yi...@apache.org on 2019/07/29 05:07:49 UTC

[dubbo] branch master updated: update referenceCount log (#4683)

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

yizhenqiang 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 87e88e2  update referenceCount log (#4683)
87e88e2 is described below

commit 87e88e28df5bb13f5f94dafdbfa72e4f93a83259
Author: Haiyang <ha...@163.com>
AuthorDate: Mon Jul 29 13:07:10 2019 +0800

    update referenceCount log (#4683)
    
    Add comments to support multiple shared connections
---
 .../main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java   | 2 +-
 .../apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java
index 3cc2023..1a9640c 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java
@@ -520,7 +520,7 @@ public class DubboProtocol extends AbstractProtocol {
     }
 
     /**
-     * Add client references in bulk
+     * Increase the reference Count if we create new invoker shares same connection, the connection will be closed without any reference.
      *
      * @param referenceCountExchangeClients
      */
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 c7074aa..bda87ca 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
@@ -192,6 +192,9 @@ final class ReferenceCountExchangeClient implements ExchangeClient {
         return client.isClosed();
     }
 
+    /**
+     * The reference count of current ExchangeClient, connection will be closed if all invokers destroyed.
+     */
     public void incrementAndGetCount() {
         referenceCount.incrementAndGet();
     }