[ 
https://issues.apache.org/jira/browse/SCB-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16338692#comment-16338692
 ] 

ASF GitHub Bot commented on SCB-297:
------------------------------------

laijianbin closed pull request #527: [SCB-297] The local cache is not update 
when the server reboots at th…
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/527
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
index 8a712bb22..04fbf1d37 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
@@ -25,6 +25,7 @@
 
 import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
 import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import org.apache.servicecomb.serviceregistry.api.Const;
 import 
org.apache.servicecomb.serviceregistry.api.registry.MicroserviceInstance;
 import 
org.apache.servicecomb.serviceregistry.api.registry.MicroserviceInstanceStatus;
 import 
org.apache.servicecomb.serviceregistry.api.response.MicroserviceInstanceChangedEvent;
@@ -195,11 +196,13 @@ protected MicroserviceVersionRule 
createAndInitMicroserviceVersionRule(String st
 
   @Subscribe
   public void onMicroserviceInstanceChanged(MicroserviceInstanceChangedEvent 
changedEvent) {
-    if (!appId.equals(changedEvent.getKey().getAppId()) ||
-        !microserviceName.equals(changedEvent.getKey().getServiceName())) {
+    boolean isEventAccept = appId.equals(changedEvent.getKey().getAppId()) &&
+        microserviceName.equals(changedEvent.getKey().getServiceName()) ||
+        microserviceName.equals(
+            changedEvent.getKey().getAppId() + Const.APP_SERVICE_SEPARATOR + 
changedEvent.getKey().getServiceName());
+    if (!isEventAccept) {
       return;
     }
-
     // pull instances always replace old instances, not append
     //
     // pull result and watch event sequence is not defined even inside SC.


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> the local cache is not updated when the  server reboots at the situation of  
> accross application
> ------------------------------------------------------------------------------------------------
>
>                 Key: SCB-297
>                 URL: https://issues.apache.org/jira/browse/SCB-297
>             Project: Apache ServiceComb
>          Issue Type: Bug
>          Components: Java-Chassis
>            Reporter: laijianbin
>            Assignee: laijianbin
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to