liubao68 commented on a change in pull request #2384:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/2384#discussion_r633246680



##########
File path: 
handlers/handler-router/src/main/java/org/apache/servicecomb/router/distribute/AbstractRouterDistributor.java
##########
@@ -140,9 +145,17 @@ public TagItem getFiltedServerTagItem(PolicyRuleItem rule, 
String targetServiceN
 
 
   public void initLatestVersion(String serviceName, List<T> list) {
-    if 
(RouterRuleCache.getServiceInfoCacheMap().get(serviceName).getLatestVersionTag()
 != null) {
-      return;
+    TagItem latestVersionTag = 
RouterRuleCache.getServiceInfoCacheMap().get(serviceName).getLatestVersionTag();
+
+    if (latestVersionTag != null) {
+      for (T server : list) {
+        E ms = getIns.apply(server);
+        if (getVersion.apply(ms).equals(latestVersionTag.getVersion())) {
+          return;
+        }
+      }
     }
+

Review comment:
       Maybe it's better to using API's in foundation-registry to find latest 
version. 
   While now, line 148~158 can be deleted, since if you check version match, 
will call getIns always, it it some as delete all these lines.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to