singleo0 commented on code in PR #4747:
URL:
https://github.com/apache/servicecomb-java-chassis/pull/4747#discussion_r2012091365
##########
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:
Thanks, I fixed it. 0b25866
--
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]