[
https://issues.apache.org/jira/browse/HDFS-13795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16575595#comment-16575595
]
Virajith Jalaparti commented on HDFS-13795:
-------------------------------------------
Thanks for the comments [~ehiggs] and [~kbjanssens]. I agree that {{read}}
returning {{Optional.empty()}} when the {{aliasMap}} is {{null}} can be
confusing.
[~kbjanssens] -- the NPE occurs when the aliasMap initialization fails (i.e.,
{{initFun.apply(conf, blockPoolId)}} throws an {{IOException}}) and then
Namenode#stop is called which in turn calls {{levelDBAliasMapServer.close()}}.
Attaching an updating patch ( [^HDFS-13795.005.patch]) which adds the null
check only to {{InMemoryLevelDBAliasMapServer#close}}.
> Fix potential NPE in InMemoryLevelDBAliasMapServer
> --------------------------------------------------
>
> Key: HDFS-13795
> URL: https://issues.apache.org/jira/browse/HDFS-13795
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Virajith Jalaparti
> Assignee: Virajith Jalaparti
> Priority: Major
> Attachments: HDFS-13795.001.patch, HDFS-13795.002.patch,
> HDFS-13795.003.patch, HDFS-13795.004.patch, HDFS-13795.005.patch
>
>
> Namenode fails to stop correctly due to NPE in InMemoryAliasMapServer, when
> it is configured incorrectly.
> {code:java}
> java.lang.NullPointerException
> at
> org.apache.hadoop.hdfs.server.aliasmap.InMemoryLevelDBAliasMapServer.close(InMemoryLevelDBAliasMapServer.java:149)
> at
> org.apache.hadoop.hdfs.server.namenode.NameNode.stop(NameNode.java:1023)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]