[
https://issues.apache.org/jira/browse/HDFS-2451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13131028#comment-13131028
]
Konstantin Shvachko commented on HDFS-2451:
-------------------------------------------
Looks like a race condition going on in the test itself.
BlockManager.countNodes() should be called under a lock (readLock()
TestNodeCount). If not under lock somebody can remove a replica between
nodeIter.hasNext() and nodeIter.next() in countNodes(), which will return NULL
and cause NPE.
> TestNodeCount.testNodeCount failes with NPE
> -------------------------------------------
>
> Key: HDFS-2451
> URL: https://issues.apache.org/jira/browse/HDFS-2451
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: name-node
> Affects Versions: 0.22.0
> Reporter: Konstantin Boudnik
> Priority: Blocker
> Attachments: HDFS-2451.patch, HDFS-2451.patch
>
>
> in the [commit build #97|http://is.gd/UPuXg2] TestNodeCount.testNodeCount
> failed with NPE
> {noformat}
> java.lang.NullPointerException
> at
> org.apache.hadoop.hdfs.server.namenode.BlockManager.countNodes(BlockManager.java:1436)
> at
> org.apache.hadoop.hdfs.server.namenode.TestNodeCount.__CLR2_4_39bdgm6whp(TestNodeCount.java:119)
> at
> org.apache.hadoop.hdfs.server.namenode.TestNodeCount.testNodeCount(TestNodeCount.java:40)
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira