You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Andrew Wang (JIRA)" <ji...@apache.org> on 2015/06/05 22:52:00 UTC
[jira] [Updated] (HADOOP-12056) Use DirectoryStream in
DiskChecker#checkDirs to detect errors when listing a directory
[ https://issues.apache.org/jira/browse/HADOOP-12056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Wang updated HADOOP-12056:
---------------------------------
Summary: Use DirectoryStream in DiskChecker#checkDirs to detect errors when listing a directory (was: DiskChecker#checkDirs should check null pointer for the return value from File#listFiles to avoid NPE.)
> Use DirectoryStream in DiskChecker#checkDirs to detect errors when listing a directory
> --------------------------------------------------------------------------------------
>
> Key: HADOOP-12056
> URL: https://issues.apache.org/jira/browse/HADOOP-12056
> Project: Hadoop Common
> Issue Type: Bug
> Components: util
> Affects Versions: 2.7.0
> Reporter: zhihai xu
> Assignee: zhihai xu
> Attachments: HADOOP-12056.000.patch, HADOOP-12056.001.patch, HADOOP-12056.002.patch, HADOOP-12056.003.patch
>
>
> DiskChecker#checkDirs should check null pointer for the return value from File#listFiles. Based on the document for File#listFiles at https://docs.oracle.com/javase/7/docs/api/java/io/File.html#listFiles() :
> {code}
> Returns null if an I/O error occurs.
> {code}
> So it will be good to check null pointer and throw DiskErrorException if it is null.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)