You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "dhruba borthakur (JIRA)" <ji...@apache.org> on 2008/03/24 18:37:24 UTC

[jira] Created: (HADOOP-3081) The static method FileSystem.mkdirs() should use the permossions to create directory

The static method FileSystem.mkdirs() should use the permossions to create directory
------------------------------------------------------------------------------------

                 Key: HADOOP-3081
                 URL: https://issues.apache.org/jira/browse/HADOOP-3081
             Project: Hadoop Core
          Issue Type: Bug
          Components: dfs
    Affects Versions: 0.16.1
            Reporter: dhruba borthakur


There is a static method FileSystem.mkdirs() that create the directory first and then sets permissions in it. Instead, it should create the directory with the correct permissions.

Otherwise, even if dfs.permission is set to off, one might see job submission failures with the following stack trace:

         at org.apache.hadoop.dfs.PermissionChecker.check(PermissionChecker.java:173)
        at 
org.apache.hadoop.dfs.PermissionChecker.checkTraverse(PermissionChecker.java:129)
        at 
org.apache.hadoop.dfs.PermissionChecker.checkPermission(PermissionChecker.java:99)
        at org.apache.hadoop.dfs.FSNamesystem.checkPermission(FSNamesystem.java:4031)
        at org.apache.hadoop.dfs.FSNamesystem.checkOwner(FSNamesystem.java:3986)
        at org.apache.hadoop.dfs.FSNamesystem.setPermission(FSNamesystem.java:715)
        at org.apache.hadoop.dfs.NameNode.setPermission(NameNode.java:297)
        at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:409)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:899)

        at org.apache.hadoop.ipc.Client.call(Client.java:512)
        at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:198)
        at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
        at 
org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
        at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
        at 
org.apache.hadoop.dfs.DistributedFileSystem.setPermission(DistributedFileSystem.java:351)
        at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:218)
        at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:688)
        at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:124)
        at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:2114)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-3081) The static method FileSystem.mkdirs() should use the correct permissions to create directory

Posted by "Allen Wittenauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-3081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581691#action_12581691 ] 

Allen Wittenauer commented on HADOOP-3081:
------------------------------------------

Is there a reason you don't just jettison the static one and  use mkdir() followed by a chmod() like  UNIX?  The static one will break setuid/setgid if/when it is supported.

> The static method FileSystem.mkdirs() should use the correct permissions to create directory
> --------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3081
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3081
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.16.1
>            Reporter: dhruba borthakur
>
> There is a static method FileSystem.mkdirs() that create the directory first and then sets permissions in it. Instead, it should create the directory with the correct permissions.
> Otherwise, even if dfs.permission is set to off, one might see job submission failures with the following stack trace:
>          at org.apache.hadoop.dfs.PermissionChecker.check(PermissionChecker.java:173)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkTraverse(PermissionChecker.java:129)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkPermission(PermissionChecker.java:99)
>         at org.apache.hadoop.dfs.FSNamesystem.checkPermission(FSNamesystem.java:4031)
>         at org.apache.hadoop.dfs.FSNamesystem.checkOwner(FSNamesystem.java:3986)
>         at org.apache.hadoop.dfs.FSNamesystem.setPermission(FSNamesystem.java:715)
>         at org.apache.hadoop.dfs.NameNode.setPermission(NameNode.java:297)
>         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:409)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:899)
>         at org.apache.hadoop.ipc.Client.call(Client.java:512)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:198)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at 
> org.apache.hadoop.dfs.DistributedFileSystem.setPermission(DistributedFileSystem.java:351)
>         at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:218)
>         at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:688)
>         at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:124)
>         at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:2114)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-3081) The static method FileSystem.mkdirs() should use the correct permissions to create directory

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-3081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581687#action_12581687 ] 

Tsz Wo (Nicholas), SZE commented on HADOOP-3081:
------------------------------------------------

The non-static FileSystem.mkdirs(Path f, FsPermission permission) and the static FileSystem.mkdirs(FileSystem fs, Path dir, FsPermission permission) look similar but they are different in semantic:
- The non-static FileSystem.mkdirs(Path f, FsPermission permission) likes mkdir in Unix, it makes a directory with *umask*.
- However, the static FileSystem.mkdirs(FileSystem fs, Path dir, FsPermission permission) makes a directory with *absolute permission*.

So I think it is better to change one of the method name (probably the static one), otherwise, it would be confusing.

> The static method FileSystem.mkdirs() should use the correct permissions to create directory
> --------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3081
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3081
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.16.1
>            Reporter: dhruba borthakur
>
> There is a static method FileSystem.mkdirs() that create the directory first and then sets permissions in it. Instead, it should create the directory with the correct permissions.
> Otherwise, even if dfs.permission is set to off, one might see job submission failures with the following stack trace:
>          at org.apache.hadoop.dfs.PermissionChecker.check(PermissionChecker.java:173)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkTraverse(PermissionChecker.java:129)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkPermission(PermissionChecker.java:99)
>         at org.apache.hadoop.dfs.FSNamesystem.checkPermission(FSNamesystem.java:4031)
>         at org.apache.hadoop.dfs.FSNamesystem.checkOwner(FSNamesystem.java:3986)
>         at org.apache.hadoop.dfs.FSNamesystem.setPermission(FSNamesystem.java:715)
>         at org.apache.hadoop.dfs.NameNode.setPermission(NameNode.java:297)
>         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:409)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:899)
>         at org.apache.hadoop.ipc.Client.call(Client.java:512)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:198)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at 
> org.apache.hadoop.dfs.DistributedFileSystem.setPermission(DistributedFileSystem.java:351)
>         at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:218)
>         at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:688)
>         at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:124)
>         at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:2114)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-3081) The static method FileSystem.mkdirs() should use the correct permissions to create directory

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-3081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581693#action_12581693 ] 

Doug Cutting commented on HADOOP-3081:
--------------------------------------

> jettison the static one and use mkdir() followed by a chmod() like UNIX?

That's exactly what the static implementation does.  It's just a utility that saves applications a few lines of code.


> The static method FileSystem.mkdirs() should use the correct permissions to create directory
> --------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3081
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3081
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.16.1
>            Reporter: dhruba borthakur
>
> There is a static method FileSystem.mkdirs() that create the directory first and then sets permissions in it. Instead, it should create the directory with the correct permissions.
> Otherwise, even if dfs.permission is set to off, one might see job submission failures with the following stack trace:
>          at org.apache.hadoop.dfs.PermissionChecker.check(PermissionChecker.java:173)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkTraverse(PermissionChecker.java:129)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkPermission(PermissionChecker.java:99)
>         at org.apache.hadoop.dfs.FSNamesystem.checkPermission(FSNamesystem.java:4031)
>         at org.apache.hadoop.dfs.FSNamesystem.checkOwner(FSNamesystem.java:3986)
>         at org.apache.hadoop.dfs.FSNamesystem.setPermission(FSNamesystem.java:715)
>         at org.apache.hadoop.dfs.NameNode.setPermission(NameNode.java:297)
>         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:409)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:899)
>         at org.apache.hadoop.ipc.Client.call(Client.java:512)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:198)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at 
> org.apache.hadoop.dfs.DistributedFileSystem.setPermission(DistributedFileSystem.java:351)
>         at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:218)
>         at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:688)
>         at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:124)
>         at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:2114)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HADOOP-3081) The static method FileSystem.mkdirs() should use the correct permissions to create directory

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

dhruba borthakur reassigned HADOOP-3081:
----------------------------------------

    Assignee: Hairong Kuang

> The static method FileSystem.mkdirs() should use the correct permissions to create directory
> --------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3081
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3081
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.16.1
>            Reporter: dhruba borthakur
>            Assignee: Hairong Kuang
>
> There is a static method FileSystem.mkdirs() that create the directory first and then sets permissions in it. Instead, it should create the directory with the correct permissions.
> Otherwise, even if dfs.permission is set to off, one might see job submission failures with the following stack trace:
>          at org.apache.hadoop.dfs.PermissionChecker.check(PermissionChecker.java:173)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkTraverse(PermissionChecker.java:129)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkPermission(PermissionChecker.java:99)
>         at org.apache.hadoop.dfs.FSNamesystem.checkPermission(FSNamesystem.java:4031)
>         at org.apache.hadoop.dfs.FSNamesystem.checkOwner(FSNamesystem.java:3986)
>         at org.apache.hadoop.dfs.FSNamesystem.setPermission(FSNamesystem.java:715)
>         at org.apache.hadoop.dfs.NameNode.setPermission(NameNode.java:297)
>         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:409)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:899)
>         at org.apache.hadoop.ipc.Client.call(Client.java:512)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:198)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at 
> org.apache.hadoop.dfs.DistributedFileSystem.setPermission(DistributedFileSystem.java:351)
>         at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:218)
>         at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:688)
>         at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:124)
>         at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:2114)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-3081) The static method FileSystem.mkdirs() should use the correct permissions to create directory

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

dhruba borthakur updated HADOOP-3081:
-------------------------------------

    Summary: The static method FileSystem.mkdirs() should use the correct permissions to create directory  (was: The static method FileSystem.mkdirs() should use the permossions to create directory)

> The static method FileSystem.mkdirs() should use the correct permissions to create directory
> --------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3081
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3081
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.16.1
>            Reporter: dhruba borthakur
>
> There is a static method FileSystem.mkdirs() that create the directory first and then sets permissions in it. Instead, it should create the directory with the correct permissions.
> Otherwise, even if dfs.permission is set to off, one might see job submission failures with the following stack trace:
>          at org.apache.hadoop.dfs.PermissionChecker.check(PermissionChecker.java:173)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkTraverse(PermissionChecker.java:129)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkPermission(PermissionChecker.java:99)
>         at org.apache.hadoop.dfs.FSNamesystem.checkPermission(FSNamesystem.java:4031)
>         at org.apache.hadoop.dfs.FSNamesystem.checkOwner(FSNamesystem.java:3986)
>         at org.apache.hadoop.dfs.FSNamesystem.setPermission(FSNamesystem.java:715)
>         at org.apache.hadoop.dfs.NameNode.setPermission(NameNode.java:297)
>         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:409)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:899)
>         at org.apache.hadoop.ipc.Client.call(Client.java:512)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:198)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at 
> org.apache.hadoop.dfs.DistributedFileSystem.setPermission(DistributedFileSystem.java:351)
>         at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:218)
>         at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:688)
>         at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:124)
>         at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:2114)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HADOOP-3081) The static method FileSystem.mkdirs() should use the correct permissions to create directory

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang resolved HADOOP-3081.
-----------------------------------

    Resolution: Invalid

> The static method FileSystem.mkdirs() should use the correct permissions to create directory
> --------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3081
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3081
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.16.1
>            Reporter: dhruba borthakur
>            Assignee: Hairong Kuang
>
> There is a static method FileSystem.mkdirs() that create the directory first and then sets permissions in it. Instead, it should create the directory with the correct permissions.
> Otherwise, even if dfs.permission is set to off, one might see job submission failures with the following stack trace:
>          at org.apache.hadoop.dfs.PermissionChecker.check(PermissionChecker.java:173)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkTraverse(PermissionChecker.java:129)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkPermission(PermissionChecker.java:99)
>         at org.apache.hadoop.dfs.FSNamesystem.checkPermission(FSNamesystem.java:4031)
>         at org.apache.hadoop.dfs.FSNamesystem.checkOwner(FSNamesystem.java:3986)
>         at org.apache.hadoop.dfs.FSNamesystem.setPermission(FSNamesystem.java:715)
>         at org.apache.hadoop.dfs.NameNode.setPermission(NameNode.java:297)
>         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:409)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:899)
>         at org.apache.hadoop.ipc.Client.call(Client.java:512)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:198)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at 
> org.apache.hadoop.dfs.DistributedFileSystem.setPermission(DistributedFileSystem.java:351)
>         at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:218)
>         at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:688)
>         at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:124)
>         at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:2114)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-3081) The static method FileSystem.mkdirs() should use the correct permissions to create directory

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-3081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581624#action_12581624 ] 

Doug Cutting commented on HADOOP-3081:
--------------------------------------

The static method is required to avoid umask, as is sometimes required, yet still have mkdirs implement POSIX conventions.  So calling mkdirs(path, permissions) won't do what's desired here, will it?

I don't see the exception in your stack trace.  How does it fail?


> The static method FileSystem.mkdirs() should use the correct permissions to create directory
> --------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3081
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3081
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.16.1
>            Reporter: dhruba borthakur
>
> There is a static method FileSystem.mkdirs() that create the directory first and then sets permissions in it. Instead, it should create the directory with the correct permissions.
> Otherwise, even if dfs.permission is set to off, one might see job submission failures with the following stack trace:
>          at org.apache.hadoop.dfs.PermissionChecker.check(PermissionChecker.java:173)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkTraverse(PermissionChecker.java:129)
>         at 
> org.apache.hadoop.dfs.PermissionChecker.checkPermission(PermissionChecker.java:99)
>         at org.apache.hadoop.dfs.FSNamesystem.checkPermission(FSNamesystem.java:4031)
>         at org.apache.hadoop.dfs.FSNamesystem.checkOwner(FSNamesystem.java:3986)
>         at org.apache.hadoop.dfs.FSNamesystem.setPermission(FSNamesystem.java:715)
>         at org.apache.hadoop.dfs.NameNode.setPermission(NameNode.java:297)
>         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:409)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:899)
>         at org.apache.hadoop.ipc.Client.call(Client.java:512)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:198)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at 
> org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy4.setPermission(Unknown Source)
>         at 
> org.apache.hadoop.dfs.DistributedFileSystem.setPermission(DistributedFileSystem.java:351)
>         at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:218)
>         at org.apache.hadoop.mapred.JobTracker.<init>(JobTracker.java:688)
>         at org.apache.hadoop.mapred.JobTracker.startTracker(JobTracker.java:124)
>         at org.apache.hadoop.mapred.JobTracker.main(JobTracker.java:2114)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.