sijie commented on a change in pull request #5966: [Issue 5952] [pulsar-broker]
fix ConcurrentModificationException while load-report
serialization/updateLocalBrokerData
URL: https://github.com/apache/pulsar/pull/5966#discussion_r363149006
##########
File path:
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/TopicStats.java
##########
@@ -121,7 +121,12 @@ public TopicStats add(TopicStats stats) {
}
} else {
for (String subscription : stats.subscriptions.keySet()) {
-
this.subscriptions.get(subscription).add(stats.subscriptions.get(subscription));
+ if (this.subscriptions.get(subscription) != null) {
Review comment:
I think we should try to use putIfAbsent to improve the logic here to handle
concurrent updates.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services