Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-7352

FileSystem#listStatus should throw IOE upon access error

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.6.0
    • 3.0.0-alpha2
    • fs
    • 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

        1. HADOOP-7352.001.patch
          8 kB
          John Zhuge
        2. HADOOP-7352.002.patch
          10 kB
          John Zhuge
        3. HADOOP-7352.003.patch
          10 kB
          John Zhuge
        4. HADOOP-7352.004.patch
          10 kB
          John Zhuge
        5. HADOOP-7352.005.patch
          10 kB
          John Zhuge

        Issue Links

          Activity

            People

              jzhuge John Zhuge
              mattf Matthew Foley
              Votes:
              0 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: