[ https://issues.apache.org/jira/browse/HADOOP-9504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13642850#comment-13642850 ]
Jason Lowe commented on HADOOP-9504: ------------------------------------ Thanks, Liang, but that doesn't resolve the issue. Threads can race through createMBeanInfo, and since all threads would be updating the same map, the set of puts from one thread could be partially clobbered by another racing thread resulting in an inconsistent map when all threads have left createMBeanInfo. I believe creating a separate map is the proper behavior, but a thread simply shouldn't publish the map to other threads (via the metricsRateAttributeMod field) until the map has been completely filled in by that thread. > create metricsRateAttributeMod with ConcurrentHashMap to avoid hashmap > concurrent race > -------------------------------------------------------------------------------------- > > Key: HADOOP-9504 > URL: https://issues.apache.org/jira/browse/HADOOP-9504 > Project: Hadoop Common > Issue Type: Bug > Components: metrics > Affects Versions: 3.0.0, 2.0.3-alpha > Reporter: Liang Xie > Assignee: Liang Xie > Priority: Critical > Attachments: HADOOP-9504.txt, HADOOP-9504-v2.txt > > > Please see HBASE-8416 for detail information. > we need to take care of the synchronization for HashMap put(), otherwise it > may lead to spin loop. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira