hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Zhuge (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HADOOP-7352) FileSystem#listStatus should throw IOE upon access error
Date Thu, 08 Sep 2016 21:26:20 GMT

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

John Zhuge edited comment on HADOOP-7352 at 9/8/16 9:25 PM:
------------------------------------------------------------

Globber has its own version of {{listStatus}} which converts IOE to empty array:
{code}
  private FileStatus[] listStatus(Path path) throws IOException {
    try {
      if (fs != null) {
        return fs.listStatus(path);
      } else {
        return fc.util().listStatus(path);
      }
    } catch (FileNotFoundException e) {
      return new FileStatus[0];
    }
  }
{code}



was (Author: jzhuge):
Globber has its own version of {{listStatus}} which converts IOE to empty array:
{code}
  private FileStatus[] listStatus(Path path) throws IOException {
    try {
      if (fs != null) {
        return fs.listStatus(path);
      } else {
        return fc.util().listStatus(path);
      }
    } catch (IOException e) {
      return new FileStatus[0];
    }
  }
{code}


> FileSystem#listStatus should throw IOE upon access error
> --------------------------------------------------------
>
>                 Key: HADOOP-7352
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7352
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 2.6.0
>            Reporter: Matt Foley
>            Assignee: John Zhuge
>         Attachments: HADOOP-7352.001.patch
>
>
> In HADOOP-6201 and HDFS-538 it was agreed that FileSystem::listStatus should throw FileNotFoundException
instead of returning null, when the target directory did not exist.
> However, in LocalFileSystem implementation today, FileSystem::listStatus still may return
null, when the target directory exists but does not grant read permission.  This causes NPE
in many callers, for all the reasons cited in HADOOP-6201 and HDFS-538.  See HADOOP-7327 and
its linked issues for examples.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message