BurningCN commented on code in PR #10297:
URL: https://github.com/apache/dubbo/pull/10297#discussion_r918520146


##########
dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java:
##########
@@ -168,8 +168,13 @@ private synchronized void 
doOnEvent(ServiceInstancesChangedEvent event) {
                     // cancel last retryFuture because only one retryFuture 
will be canceled at destroy().
                     retryFuture.cancel(true);
                 }
-                retryFuture = scheduler.schedule(new 
AddressRefreshRetryTask(retryPermission, event.getServiceName()), 10_000L, 
TimeUnit.MILLISECONDS);
-                logger.warn("Address refresh try task submitted");
+
+                int retryCount = 0;
+                if (event instanceof RetryServiceInstancesChangedEvent) {
+                    retryCount = ((RetryServiceInstancesChangedEvent) 
event).getRetryCount() + 1;
+                }
+

Review Comment:
   重试次数是否超过最大值的判断逻辑是否可以放在执行schedule任务前。而非执行任务的时候即10s后才发现超过次数。
   
   



-- 
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