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 2022/07/12 03:44:08 UTC

[GitHub] [dubbo] BurningCN commented on a diff in pull request #10297: fix for issue#10283

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