You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/18 02:17:08 UTC

[GitHub] [dubbo] changfubai commented on a change in pull request #8815: [master] do not show the warning at first replaceWithLazyClient()

changfubai commented on a change in pull request #8815:
URL: https://github.com/apache/dubbo/pull/8815#discussion_r711425420



##########
File path: dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/ReferenceCountExchangeClient.java
##########
@@ -197,20 +197,19 @@ public void startClose() {
      * @return
      */
     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(SEND_RECONNECT_KEY, Boolean.TRUE.toString());
-        //.addParameter(LazyConnectExchangeClient.REQUEST_WITH_WARNING_KEY, true);
-
-        if (disconnectCount.getAndIncrement() % maxDisconnectCount == 0) {
+        if (disconnectCount.getAndIncrement() % maxDisconnectCount == 1) {

Review comment:
       这个的逻辑不是说,要超过maxDisconnectCount数后才打日志么?
   默认maxDisconnectCount=50, 这样不就是disconnectCount=1的时候(第一次调用replaceWithLazyClient的时候)就打日志了么?
   所以原逻辑应该是正确的呀,disconnectCount.getAndIncrement()第一次就是1了,要失败50次后才会满足条件打日志。
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org