poorbarcode commented on code in PR #21781:
URL: https://github.com/apache/pulsar/pull/21781#discussion_r1436227866


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupConfigListenerTest.java:
##########
@@ -288,4 +298,27 @@ private void prepareData() throws PulsarAdminException {
         testAddRg.setDispatchRateInBytes(200L);
 
     }
+
+    @Test
+    public void testLoadAllResourceGroupsAsyncFailed() {

Review Comment:
   > This root cause loadAllResourceGroupsAsync is async call, we need to wait 
for this loading to complete, and then call new 
ResourceGroupNamespaceConfigListener.
   
   You added 2 tests, and they only did the things below:
   - call `new ResourceGroupNamespaceConfigListener`
   - inject an Ex in the constructor of `ResourceGroupNamespaceConfigListener`
   
   They are too simple to let others know why the error `Resource group does 
not exist: rg-1` throws, and why the current change can avoid the error.
   
   I just know that this patch will make `new 
ResourceGroupNamespaceConfigListener` get an Ex immediately if 
`rgResources.listResourceGroupsAsync` throws an Ex, Pulsar ignored the Ex of 
`rgResources.listResourceGroupsAsync` before.



-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to