chengyouling commented on code in PR #4747:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/4747#discussion_r2011170129


##########
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombLoadBalancerStats.java:
##########
@@ -157,17 +162,29 @@ public ServiceCombServerStats load(ServiceCombServer 
server) {
 
     timer = new Timer("LoadBalancerStatsTimer", true);
     timer.schedule(new TimerTask() {
-      private final MicroserviceInstancePing ping = 
SPIServiceUtils.getPriorityHighestService(MicroserviceInstancePing.class);
+      private final MicroserviceInstancePing ping = SPIServiceUtils
+          .getPriorityHighestService(MicroserviceInstancePing.class);
 
       @Override
       public void run() {
         try {
           Map<ServiceCombServer, ServiceCombServerStats> allServers = pingView;
           allServers.forEach((server, stats) -> {
-            if ((System.currentTimeMillis() - stats.getLastVisitTime() > 
timerIntervalInMillis) && !ping
-                .ping(server.getInstance())) {
-              LOGGER.info("ping mark server {} failure.", 
server.getInstance().getInstanceId());
-              stats.markFailure();
+            //get all microservice instances
+            MicroserviceVersions microserviceVersions = 
DiscoveryManager.INSTANCE.getOrCreateMicroserviceVersions(
+                RegistrationManager.INSTANCE.getAppId(), 
server.getMicroserviceName());

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