[ 
https://issues.apache.org/jira/browse/HDFS-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794199#action_12794199
 ] 

Steve Loughran commented on HDFS-42:
------------------------------------

So, what to do here?

# move that string in conf.get to a package scoped constant 
DFS_DATANODE_IPC_ADDRESS
# when the result of conf.get is null, raise an exception "No value defined for 
"+ DFS_DATANODE_IPC_ADDRESS (this could be another package scoped string)
# test: create a configuration without this value, try to create a datanode, 
look for the relevant string as the message in the exception

Question: what exception to raise? IOException?

> NetUtils.createSocketAddr NPEs if dfs.datanode.ipc.address is not set for a 
> data node
> -------------------------------------------------------------------------------------
>
>                 Key: HDFS-42
>                 URL: https://issues.apache.org/jira/browse/HDFS-42
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 0.20.1, 0.20.2, 0.21.0, 0.22.0
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>            Priority: Minor
>
> DataNode.startDatanode assumes that a configuration always returns a non-null 
> dfs.datanode.ipc.address value, as the result is passed straight down to 
> NetUtils.createSocketAddr
> InetSocketAddress ipcAddr = NetUtils.createSocketAddr(
>         conf.get("dfs.datanode.ipc.address"));
> which triggers an NPE
> Caused by: java.lang.NullPointerException
> at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:130)
> at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:119)
> at org.apache.hadoop.dfs.DataNode.startDataNode(DataNode.java:353)
> at org.apache.hadoop.dfs.DataNode.(DataNode.java:185)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to