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



##########
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:
       
完全关闭之后再close说明代码有bug,需要告警,但是不要频繁告警,所以需要设置个抑制策略,比如50次报警一次,maxDisconnectCount这个名称不合理,应该是告警周期warning_period,就像LazyConnectExchangeClient那样,只是后者复用已关闭的client就是bug,应该立即告警,这是为啥后者要==0比较,这里用==1的原因。




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to