[ https://issues.apache.org/jira/browse/HADOOP-11361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15363120#comment-15363120 ]
Yongjun Zhang commented on HADOOP-11361: ---------------------------------------- Hi [~brahmareddy], I took a quick look at your latest patch, You removed {code} lastRecs = null; // in case regular interval update is not running {code} and added {code} 189 // Not making LastRecs null due to Race between multiple readers and 190 // updater 190 lastRecsCleared = true; {code} Given that the code is doing {{lastRecsCleared = true;}}, the comment "Not making LastRecs null ..." is a bit contradictory. It looks to me that it's actually not a race condition issue (otherwise please would you please explain what race condition you are seeing), because it looks that a single thread would run into the same problem as explained in my comment linked above. So seems to me that the solution would be to fix {{MetricsSourceAdapter#updateAttrCache}} to let it check whether lastRecs is NULL, and not to access it if so. Does it make sense to you? Thanks. > 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 > Attachments: HADOOP-111361-003.patch, HADOOP-11361-002.patch, > HADOOP-11361-004.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) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org