zhaizhibo commented on code in PR #24639:
URL: https://github.com/apache/pulsar/pull/24639#discussion_r2282264124


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/resources/MetadataStoreCacheLoader.java:
##########
@@ -61,26 +63,28 @@ public MetadataStoreCacheLoader(PulsarResources 
pulsarResources, int operationTi
      * @throws Exception
      */
     public void init() throws Exception {
-        loadReportResources.getStore().registerListener((n) -> {
-            if (LOADBALANCE_BROKERS_ROOT.equals(n.getPath()) && 
NotificationType.ChildrenChanged.equals(n.getType())) {
-                
loadReportResources.getChildrenAsync(LOADBALANCE_BROKERS_ROOT).thenApplyAsync((brokerNodes)->{
-                    updateBrokerList(brokerNodes).thenRun(() -> {
-                        log.info("Successfully updated broker info {}", 
brokerNodes);
-                    }).exceptionally(ex -> {
-                        log.warn("Error updating broker info after broker list 
changed", ex);
-                        return null;
+        Runnable tryUpdate = () -> {
+            synchronized (this) {
+                updateFuture = updateFuture.thenCompose(__ -> {

Review Comment:
   fixed.



-- 
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: [email protected]

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

Reply via email to