You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2021/01/12 23:36:53 UTC

[GitHub] [storm] bipinprasad commented on a change in pull request #3371: STORM-3682 Upgrade netty client metrics to use V2 API

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