Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.6.0
-
None
-
Incompatible change, Reviewed
-
Change FileSystem#listStatus contract to never return null. Local filesystems prior to 3.0.0 returned null upon access error. It is considered erroneous. We should expect FileSystem#listStatus to throw IOException upon access error.
Description
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.
Attachments
Attachments
Issue Links
- breaks
-
YARN-5777 TestLogsCLI#testFetchApplictionLogsAsAnotherUser fails
- Resolved
-
HADOOP-13787 Azure testGlobStatusThrowsExceptionForUnreadableDir fails
- Resolved
- is blocked by
-
HADOOP-7363 TestRawLocalFileSystemContract is needed
- Resolved
- is depended upon by
-
HADOOP-12718 Incorrect error message by fs -put local dir without permission
- Resolved
- is duplicated by
-
HADOOP-6377 ChecksumFileSystem.getContentSummary throws NPE when directory contains inaccessible directories
- Resolved
-
HADOOP-13191 FileSystem#listStatus should not return null
- Resolved
- is related to
-
HADOOP-13795 Skip testGlobStatusThrowsExceptionForUnreadableDir in TestFSMainOperationsSwift
- Resolved
-
HADOOP-7327 FileSystem.listStatus() throws NullPointerException instead of IOException upon access permission failure
- Closed
-
HADOOP-9361 Strictly define the expected behavior of filesystem APIs and write tests to verify compliance
- Closed
- relates to
-
HADOOP-13373 Add S3A implementation of FSMainOperationsBaseTest
- Resolved
-
HDFS-538 DistributedFileSystem::listStatus incorrectly returns null for empty result sets
- Closed
-
HDFS-303 Make contracts of LocalFileSystem and DistributedFileSystem consistent
- Resolved
-
HADOOP-6201 FileSystem::ListStatus should throw FileNotFoundException
- Closed