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

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

WillemJiang commented on a change in pull request #761: [SCB-658] 
MicroserviceVersions eventbus leak
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/761#discussion_r194200430
 
 

 ##########
 File path: 
service-registry/src/test/java/org/apache/servicecomb/serviceregistry/consumer/TestMicroserviceManager.java
 ##########
 @@ -98,11 +100,23 @@ public void testCreateRuleServiceNotExists() {
       }
     };
 
+    AtomicInteger triggerCount = new AtomicInteger();
+    new MockUp<MicroserviceVersions>() {
+      @Mock
+      void onMicroserviceInstanceChanged(MicroserviceInstanceChangedEvent 
changedEvent) {
+        triggerCount.incrementAndGet();
+      }
+    };
+
     MicroserviceVersionRule microserviceVersionRule =
         microserviceManager.getOrCreateMicroserviceVersionRule(serviceName, 
versionRule);
     Assert.assertEquals("0.0.0+", 
microserviceVersionRule.getVersionRule().getVersionRule());
     Assert.assertNull(microserviceVersionRule.getLatestMicroserviceVersion());
     Assert.assertEquals(0, cachedVersions.size());
+
+    MicroserviceInstanceChangedEvent changedEvent = new 
MicroserviceInstanceChangedEvent();
+    eventBus.post(changedEvent);
+    Assert.assertEquals(0, triggerCount.get());
 
 Review comment:
   Does the changedEvnet trigger the onMicroserviveInstranceChanged method?

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


> leak of MicroserviceVersions register to EventBus
> -------------------------------------------------
>
>                 Key: SCB-658
>                 URL: https://issues.apache.org/jira/browse/SCB-658
>             Project: Apache ServiceComb
>          Issue Type: Bug
>          Components: Java-Chassis
>            Reporter: wujimin
>            Assignee: wujimin
>            Priority: Major
>
> org.apache.servicecomb.serviceregistry.consumer.MicroserviceManager#getOrCreateMicroserviceVersions
> when removed from versionsByName, microserviceVersions must unregistered from 
> eventBus



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

Reply via email to