poorbarcode commented on code in PR #16953:
URL: https://github.com/apache/pulsar/pull/16953#discussion_r938617143
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImpl.java:
##########
@@ -197,7 +197,7 @@ public class ModularLoadManagerImpl implements
ModularLoadManager {
private long unloadBundleCount = 0;
private final Lock lock = new ReentrantLock();
- private Set<String> knownBrokers = new HashSet<>();
+ private Set<String> knownBrokers = ConcurrentHashMap.newKeySet();
Review Comment:
Maybe we can move this line below to method `start` and add some code
comments, this could solves the concurrency problem.
https://github.com/apache/pulsar/blob/7650612cd86ead01886300f9b31aba6946831736/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImpl.java#L249
--
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]