Hadoop Common
  1. Hadoop Common
  2. HADOOP-9502

chmod does not return error exit codes for some exceptions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: fs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When some dfs operations fail due to SnapshotAccessControlException, valid exit codes are not returned.

      E.g:

      -bash-4.1$  hadoop dfs -chmod -R 755 /user/foo/hdfs-snapshots/test0/.snapshot/s0
      chmod: changing permissions of 'hdfs://<namenode>:8020/user/foo/hdfs-snapshots/test0/.snapshot/s0':org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotAccessControlException: Modification on read-only snapshot is disallowed
      
      -bash-4.1$ echo $?
      0
      
      -bash-4.1$  hadoop dfs -chown -R hdfs:users /user/foo/hdfs-snapshots/test0/.snapshot/s0
      chown: changing ownership of 'hdfs://<namenode>:8020/user/foo/hdfs-snapshots/test0/.snapshot/s0':org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotAccessControlException: Modification on read-only snapshot is disallowed
      
      -bash-4.1$ echo $?
      0
      

      Similar problems exist for some other exceptions such as SafeModeException.

      1. c9502_20130424.patch
        3 kB
        Tsz Wo Nicholas Sze

        Issue Links

          Activity

          Hide
          Tsz Wo Nicholas Sze added a comment -

          I think it is a bug in trunk: FsShellPermissions does not return error code when there is an exception.

          Show
          Tsz Wo Nicholas Sze added a comment - I think it is a bug in trunk: FsShellPermissions does not return error code when there is an exception.
          Hide
          Tsz Wo Nicholas Sze added a comment -

          I have verified it. This is a general chmod problem in branch-1.

          Show
          Tsz Wo Nicholas Sze added a comment - I have verified it. This is a general chmod problem in branch-1.
          Hide
          Tsz Wo Nicholas Sze added a comment -

          c9502_20130424.patch: fix FsShellPermissions

          Show
          Tsz Wo Nicholas Sze added a comment - c9502_20130424.patch: fix FsShellPermissions
          Hide
          Suresh Srinivas added a comment -

          +1 for the change.

          Show
          Suresh Srinivas added a comment - +1 for the change.
          Hide
          Tsz Wo Nicholas Sze added a comment -
               [exec] -1 overall.  
               [exec] 
               [exec]     +1 @author.  The patch does not contain any @author tags.
               [exec] 
               [exec]     -1 tests included.  The patch doesn't appear to include any new or modified tests.
               [exec]                         Please justify why no tests are needed for this patch.
               [exec] 
               [exec]     +1 javadoc.  The javadoc tool did not generate any warning messages.
               [exec] 
               [exec]     +1 javac.  The applied patch does not increase the total number of javac compiler warnings.
               [exec] 
               [exec]     -1 findbugs.  The patch appears to introduce 19 new Findbugs (version 1.3.9) warnings.
          

          The fingbugs warnings are not related.

          I tested the patch manually. It worked well.

          Show
          Tsz Wo Nicholas Sze added a comment - [exec] -1 overall. [exec] [exec] +1 @author. The patch does not contain any @author tags. [exec] [exec] -1 tests included. The patch doesn't appear to include any new or modified tests. [exec] Please justify why no tests are needed for this patch. [exec] [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] [exec] -1 findbugs. The patch appears to introduce 19 new Findbugs (version 1.3.9) warnings. The fingbugs warnings are not related. I tested the patch manually. It worked well.
          Hide
          Tsz Wo Nicholas Sze added a comment -

          I have committed this.

          Show
          Tsz Wo Nicholas Sze added a comment - I have committed this.
          Hide
          Matt Foley added a comment -

          Closed upon release of Hadoop 1.2.0.

          Show
          Matt Foley added a comment - Closed upon release of Hadoop 1.2.0.

            People

            • Assignee:
              Tsz Wo Nicholas Sze
              Reporter:
              Ramya Sunil
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development