You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/23 18:50:57 UTC
[GitHub] [pulsar] 315157973 opened a new pull request #10347: Fix ConcurrentModificationException when attempting to update local broker data
315157973 opened a new pull request #10347:
URL: https://github.com/apache/pulsar/pull/10347
Fixes #10229
### Motivation
`updateLocalBrokerData` will be called concurrently in the REST API
`writeBrokerDataOnZooKeeper` will be called concurrently in REST API and Scheduled Task
It is not enough to ensure the thread safety of APIs in LocalBrokerData.
It is necessary to ensure the thread safety of multiple APIs in LocalBrokerData at the same time.
So I added the lock to the two methods above.
--
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:
users@infra.apache.org
[GitHub] [pulsar] lhotari commented on a change in pull request #10347: Fix ConcurrentModificationException when attempting to update local broker data
Posted by GitBox <gi...@apache.org>.
lhotari commented on a change in pull request #10347:
URL: https://github.com/apache/pulsar/pull/10347#discussion_r621143819
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ModularLoadManagerImpl.java
##########
@@ -198,6 +201,8 @@
private long unloadBrokerCount = 0;
private long unloadBundleCount = 0;
+ private Lock lock = new ReentrantLock();
Review comment:
make the field also `final`
--
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:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui merged pull request #10347: Fix ConcurrentModificationException when attempting to update local broker data
Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #10347:
URL: https://github.com/apache/pulsar/pull/10347
--
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:
users@infra.apache.org