Hadoop Common
  1. Hadoop Common
  2. HADOOP-6145

No error message for deleting non-existant file or directory.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.1
    • Fix Version/s: 0.20.1
    • Component/s: fs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Tags:
      ygridqa

      Description

      If non-existant path or src is provided with rm/rmr option then no error message is displayed
      command: hadoop dfs -rm <src> (where src is non-existant)
      dfs displays "rm: <src>"
      while it should display "No such file or directory".

      1. COMMON-6145.patch
        1 kB
        Jakob Homan
      2. COMMON-6145.patch
        2 kB
        Jakob Homan
      3. HADOOP-6145.patch
        1 kB
        Jakob Homan
      4. HADOOP-6145.patch
        1 kB
        Jakob Homan

        Activity

        Hide
        Jakob Homan added a comment -

        I can't reproduce this.

        $ bin/hadoop dfs -rm /build.xml
        rm: cannot remove /build.xml: No such file or directory.
        $ bin/hadoop fs -rm /build.xml
        rm: cannot remove /build.xml: No such file or directory.
        

        I'm running off the same build as I believe you are. I'll need more information to track this down further.

        Show
        Jakob Homan added a comment - I can't reproduce this. $ bin/hadoop dfs -rm /build.xml rm: cannot remove /build.xml: No such file or directory. $ bin/hadoop fs -rm /build.xml rm: cannot remove /build.xml: No such file or directory. I'm running off the same build as I believe you are. I'll need more information to track this down further.
        Hide
        Jakob Homan added a comment -

        Moved to Common as bug was tracked to FsShell, which is in Common.

        Show
        Jakob Homan added a comment - Moved to Common as bug was tracked to FsShell, which is in Common.
        Hide
        Jakob Homan added a comment -

        Attaching patch for v20

        Show
        Jakob Homan added a comment - Attaching patch for v20
        Hide
        Jakob Homan added a comment -

        Attaching patch for trunk.
        Problem was the trash method was throwing FileNotFound, which was not being handled. There are three different places where the non-existence of the file being deleted could conceivably be handled. Fixed by just checking for the file's existence at the beginning and exiting if not found.

        No unit test because the affected unit test is TestHDFSCLI, which is in HDFS project. Manually tested and it works. The reason this wasn't detected previously is that it only manifests itself when the trash feature is enabled, which apparently it isn't on the minidfscluster that powers TestCLI. We should probably looking at running Test*CLI with both trash on and trash off.

        Show
        Jakob Homan added a comment - Attaching patch for trunk. Problem was the trash method was throwing FileNotFound, which was not being handled. There are three different places where the non-existence of the file being deleted could conceivably be handled. Fixed by just checking for the file's existence at the beginning and exiting if not found. No unit test because the affected unit test is TestHDFSCLI, which is in HDFS project. Manually tested and it works. The reason this wasn't detected previously is that it only manifests itself when the trash feature is enabled, which apparently it isn't on the minidfscluster that powers TestCLI. We should probably looking at running Test*CLI with both trash on and trash off.
        Hide
        Jakob Homan added a comment -

        submitting patch. Hudson should pick up the correct one.

        Show
        Jakob Homan added a comment - submitting patch. Hudson should pick up the correct one.
        Hide
        Jakob Homan added a comment -

        also, the trunk patch has a quick fix to bring the rm documentation in line with what was committed in HADOOP-6139.

        Show
        Jakob Homan added a comment - also, the trunk patch has a quick fix to bring the rm documentation in line with what was committed in HADOOP-6139 .
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12413186/COMMON-6145.patch
        against trunk revision 793162.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/568/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/568/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/568/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/568/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12413186/COMMON-6145.patch against trunk revision 793162. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/568/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/568/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/568/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/568/console This message is automatically generated.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        srcFs.exists(src) and srcFs.isDirectory(src) both call srcFs.getFileStatus(src). We could call srcFs.getFileStatus(src) once in FsShell.delete(..) and save a rpc.

        Show
        Tsz Wo Nicholas Sze added a comment - srcFs.exists(src) and srcFs.isDirectory(src) both call srcFs.getFileStatus(src). We could call srcFs.getFileStatus(src) once in FsShell.delete(..) and save a rpc.
        Hide
        Jakob Homan added a comment -

        canceling patch

        Show
        Jakob Homan added a comment - canceling patch
        Hide
        Jakob Homan added a comment -

        attaching new v20 patch

        Show
        Jakob Homan added a comment - attaching new v20 patch
        Hide
        Jakob Homan added a comment -

        Attaching new Common patch for hudson.

        Show
        Jakob Homan added a comment - Attaching new Common patch for hudson.
        Hide
        Jakob Homan added a comment -

        submitting patch

        Show
        Jakob Homan added a comment - submitting patch
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12413359/COMMON-6145.patch
        against trunk revision 793162.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/571/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/571/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/571/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/571/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12413359/COMMON-6145.patch against trunk revision 793162. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/571/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/571/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/571/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/571/console This message is automatically generated.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        +1 patch looks good.

        Show
        Tsz Wo Nicholas Sze added a comment - +1 patch looks good.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        I have committed this to 0.20 and above. Thanks, Jakob!

        Show
        Tsz Wo Nicholas Sze added a comment - I have committed this to 0.20 and above. Thanks, Jakob!
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk #27 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Common-trunk/27/)
        . Fix FsShell rm/rmr error messages when there is a FNFE. Contributed by Jakob Homan

        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk #27 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Common-trunk/27/ ) . Fix FsShell rm/rmr error messages when there is a FNFE. Contributed by Jakob Homan

          People

          • Assignee:
            Jakob Homan
            Reporter:
            Suman Sehgal
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development