chengyouling commented on code in PR #4878:
URL:
https://github.com/apache/servicecomb-java-chassis/pull/4878#discussion_r2224607244
##########
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]