hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Dobbins (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12080) swiftfs ls fails with NPE for dirs with single file
Date Wed, 10 Jun 2015 13:59:01 GMT

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

David Dobbins commented on HADOOP-12080:
----------------------------------------

Seems to me that the assumption that Globber is making (for any file that exists, the parent
path should also exist) is reasonable, so I don't think Globber needs to change (though it
could do better to protect against the NPE).  I believe swiftfs should behave consistently
with what Globber is expecting and either:
a) don't return any child objects at all if the parent doesn't exist (i.e. baz is not a child
of /foo/bar if /foo/bar doesn't exist); or
b) allow "implicit" directories and return information for /foo/bar so long as one or more
objects exist with a prefix of /foo/bar/


> swiftfs ls fails with NPE for dirs with single file
> ---------------------------------------------------
>
>                 Key: HADOOP-12080
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12080
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs/swift
>    Affects Versions: 2.3.0
>            Reporter: David Dobbins
>            Assignee: David Dobbins
>            Priority: Minor
>
> NPE from Globber.java (line 230) if a directory has only one child *and* there is no
explicit parent directory object.  
> To reproduce, create an object in swift directly (not using swiftfs), e.g. /foo/bar/baz
in container test.  Then, try to ls the "directory" for that object:
> hdfs dfs -ls swift://test.myswift/foo/bar/*
> This fails for dirs containing single files because in Globber.java there is a specific
test for objects with a single child.  The getFileStatus() call returns null for the object's
parent (because no explicit directory object was created in swift).  However, Globber assumes
that if the child exists getPath() will return an object that exist.



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

Mime
View raw message