bipinprasad commented on a change in pull request #3371:
URL: https://github.com/apache/storm/pull/3371#discussion_r556167382



##########
File path: storm-client/src/jvm/org/apache/storm/metrics2/TaskMetricRepo.java
##########
@@ -34,23 +34,33 @@
     private SortedMap<String, Timer> timers = new TreeMap<>();
 
     public void addCounter(String name, Counter counter) {
-        counters.put(name, counter);
+        synchronized (this) {

Review comment:
       Looks like all the synchronization blocks are the fully body of the 
function, i.e. equivalent synchronized methods. If the intent is to make it 
finer grained, then the lock should be on "counters"  in the add....() methods 
and for each treeMap in the deregisterMetrics().




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to