[ 
https://issues.apache.org/jira/browse/HADOOP-8973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13597336#comment-13597336
 ] 

Chris Nauroth commented on HADOOP-8973:
---------------------------------------

{quote}
If java 7 File.canWrite etc are going to work on Windows (like mentioned in 
some comments above) then we could enable the API path when (!Windows or 
Java>6).
{quote}

Sorry, let me clarify the Java 7 situation.  Java 7 does not fix the bugs in 
java.io.File canRead/canWrite/canExecute.  Instead, it adds new methods that 
are very similar in {{java.nio.file.Files}}, and these new methods are the ones 
that correctly handle ACLs:

http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html

I'm not sure why they didn't just fix the bugs in {{java.io.File}}, but that's 
the way it is.  This means that it wouldn't be correct to do if (JDK7) then use 
File methods.  We have to wait for Hadoop as a whole go to JDK7 (for compile 
time, not just runtime) and migrate the {{DiskChecker}} code to use the new 
APIs.  Unfortunately, we can't do anything right now in this patch to prepare 
for that.

The old Sun bug report has some relevant discussion:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6203387

{quote}
Please do open a jira to fix this issue in branch-1-win too.
{quote}

Actually, I was planning on doing this in scope of the current jira.  I just 
wanted to get buy-in on the trunk patch first.  I expect to have the branch-1 
patch ready later today.

                
> DiskChecker cannot reliably detect an inaccessible disk on Windows with NTFS 
> ACLs
> ---------------------------------------------------------------------------------
>
>                 Key: HADOOP-8973
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8973
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 3.0.0
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HADOOP-8973.3.patch, 
> HADOOP-8973-branch-trunk-win.2.patch, HADOOP-8973-branch-trunk-win.patch
>
>
> DiskChecker.checkDir uses File.canRead, File.canWrite, and File.canExecute to 
> check if a directory is inaccessible.  These APIs are not reliable on Windows 
> with NTFS ACLs due to a known JVM bug.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to