thetumbled commented on code in PR #22753:
URL: https://github.com/apache/pulsar/pull/22753#discussion_r1616011333


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImpl.java:
##########
@@ -1131,11 +1161,16 @@ public void writeBundleDataOnZooKeeper() {
         // Write the bundle data to metadata store.
         List<CompletableFuture<Void>> futures = new ArrayList<>();
 
-        for (Map.Entry<String, BundleData> entry : 
loadData.getBundleData().entrySet()) {
-            final String bundle = entry.getKey();
-            final BundleData data = entry.getValue();
-            futures.add(
-                    
pulsarResources.getLoadBalanceResources().getBundleDataResources().updateBundleData(bundle,
 data));
+        // use synchronized to protect bundleArr.
+        synchronized (this) {

Review Comment:
   good idea.



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