[ https://issues.apache.org/jira/browse/HADOOP-11361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15024900#comment-15024900 ]
Jason Lowe commented on HADOOP-11361: ------------------------------------- It appears this change can lead to a deadlock in the metrics subsystem. See HADOOP-12594. This change allows the MetricsSourceAdapter to hold a lock on itself while trying to get a lock on the MetricsSystemImpl. Note that prior to this change the getMetrics method was careful to only grab the lock outside of the source.getMetrics call, but now the method is being invoked while holding the adapter lock. That ends up grabbing the locks in the opposite order that the metrics system does and we can deadlock. > Fix a race condition in MetricsSourceAdapter.updateJmxCache > ----------------------------------------------------------- > > Key: HADOOP-11361 > URL: https://issues.apache.org/jira/browse/HADOOP-11361 > Project: Hadoop Common > Issue Type: Bug > Affects Versions: 2.4.1, 2.5.1, 2.6.0 > Reporter: Brahma Reddy Battula > Assignee: Brahma Reddy Battula > Fix For: 2.8.0, 2.7.3 > > Attachments: HADOOP-111361-003.patch, HADOOP-11361-002.patch, > HADOOP-11361.patch, HDFS-7487.patch > > > {noformat} > Caused by: java.lang.NullPointerException > at > org.apache.hadoop.metrics2.impl.MetricsSourceAdapter.updateAttrCache(MetricsSourceAdapter.java:247) > at > org.apache.hadoop.metrics2.impl.MetricsSourceAdapter.updateJmxCache(MetricsSourceAdapter.java:177) > at > org.apache.hadoop.metrics2.impl.MetricsSourceAdapter.getAttribute(MetricsSourceAdapter.java:102) > at > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:647) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)