humingcheng commented on code in PR #4878:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/4878#discussion_r2224534065


##########
clients/service-center-client/src/main/java/org/apache/servicecomb/service/center/client/ServiceCenterDiscovery.java:
##########
@@ -236,10 +229,13 @@ public void execute() {
 
   private synchronized void pullAllInstance() {
     List<SubscriptionKey> failedInstances = new ArrayList<>();
-    instancesCache.forEach((k, v) -> failedInstances.addAll(pullInstance(k, v, 
true)));
-    if (failedInstances.isEmpty()) {
-      return;
-    }
+    instancesCache.forEach((k, v) -> {
+      pullInstance(k, v, true);
+      v.instancesCache.removeIf(instance -> 
isInstanceUnavailable(instance.getServiceName(), instance.getEndpoints()));

Review Comment:
   这个检查会大大拖慢服务发现的速度,代价高而收益似乎不明确,具体背景是什么。



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

Reply via email to