[ 
https://issues.apache.org/jira/browse/HADOOP-4128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629450#action_12629450
 ] 

Steve Loughran commented on HADOOP-4128:
----------------------------------------

the line in question assumes that dir.listFiles() never returns a null list

      File blockFiles[] = dir.listFiles();
      for (int i = 0; i < blockFiles.length; i++) {    ///here

This assumption is at odds with the contract of java.io.File.listFiles, which 
states

" Returns null if this abstract pathname does not denote a directory, or if an 
I/O error occurs."

FSDir.getBlockInfo() needs to check for a null return value and fail with a 
helpful message in such a circumstance

> NPE in FSDir.getBlockInfo
> -------------------------
>
>                 Key: HADOOP-4128
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4128
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.19.0
>            Reporter: Steve Loughran
>            Priority: Minor
>
> This could well be something I've introduced on my variant of the code, 
> although its a recent arrival in my own tests: an NPE while bringing up a 
> datanode.

-- 
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