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


##########
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`.
   ```java
       public ResourceGroupConfigListener(ResourceGroupService rgService, 
PulsarService pulsarService) {
           this.rgService = rgService;
           this.pulsarService = pulsarService;
           this.rgResources = 
pulsarService.getPulsarResources().getResourcegroupResources();
           loadAllResourceGroupsAsync()
                   
.get(pulsarService.getConfiguration().getMetadataStoreOperationTimeoutSeconds(),
 TimeUnit.SECONDS);
           this.rgResources.getStore().registerListener(this);
           rgNamespaceConfigListener = new ResourceGroupNamespaceConfigListener(
                   rgService, pulsarService, this);
       }
   ```
   
   



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