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:
   Instances cannot be queried in across application scenarios, or call error 
application that should not be invoked. is need to consider this scenario?
   And how much is the performance loss? What's scenario where the loss is 
high? This ping should have a small loss.......
   @singleo0 



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