hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao Chen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7352) FileSystem#listStatus should throw IOE upon access error
Date Mon, 26 Sep 2016 18:01:21 GMT

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

Xiao Chen commented on HADOOP-7352:

Thanks John for the work again. I think the patch makes sense and addresses the initial concerns.
Some nits and a question:
-    if (listing == null) {
-      throw new IOException("Error accessing " + f);
-    }
I think we can put a preconditions check here, to make it more explicit if some implementation
returns a null.

Let's specify 'prior to 3.0.0', instead of 'in the past'.

Regarding {{Globber#doGlob}}, it seems to be a separated case?
     * When the input pattern "looks" like just a simple filename, and we
     * can't find it, we return null rather than an empty array.
     * This is a special case which the shell relies on.
     * To be more precise: if there were no results, AND there were no
     * groupings (aka brackets), and no wildcards in the input (aka stars),
     * we return null.
    if ((!sawWildcard) && results.isEmpty() &&
        (flattenedPatterns.size() <= 1)) {
      return null;

> 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, HADOOP-7352.002.patch, HADOOP-7352.003.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

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

View raw message