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

TestFileContextResolveAfs#testFileContextResolveAfs creates dangling link and fails for subsequent runs

    XMLWordPrintableJSON

    Details

    • Hadoop Flags:
      Reviewed
    • Flags:
      Patch

      Description

      In the test testFileContextResolveAfs, the symlink TestFileContextResolveAfs2 (linked to TestFileContextResolveAfs1) cannot be deleted when the test finishes.

      This is because TestFileContextResolveAfs1 was always deleted before TestFileContextResolveAfs2 when they were both passed into FileSystem#deleteOnExit. This caused TestFileContextResolveAfs2 to become a dangling link, which FileSystem in Hadoop currently cannot delete. (This is because Files#exists will return false for dangling links.)

      As a result, the test `testFileContextResolveAfs` only passed for the first run. And for later runs of this test, it will fail by throwing the following exception: 

      fs.FileUtil (FileUtil.java:symLink(821)) - Command 'ln -s mypath/TestFileContextResolveAfs1 mypath/TestFileContextResolveAfs2' failed 1 with: ln: mypath/TestFileContextResolveAfs2: File exists
      
      java.io.IOException: Error 1 creating symlink file:mypath/TestFileContextResolveAfs2 to mypath/TestFileContextResolveAfs1
      

        Attachments

        1. HADOOP-16971.000.patch
          0.9 kB
          Ctest

          Activity

            People

            • Assignee:
              ctest.team Ctest
              Reporter:
              ctest.team Ctest
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: