[
https://issues.apache.org/jira/browse/HADOOP-12258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14638142#comment-14638142
]
zhihai xu commented on HADOOP-12258:
------------------------------------
The following is the stack trace for NoSuchFileException:
{code}
java.nio.file.NoSuchFileException:
/home/jenkins/jenkins-slave/workspace/PreCommit-YARN-Build/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/target/org.apache.hadoop.yarn.server.nodemanager.TestDeletionService/4864664428353279771
at
sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at
sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
at
sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at
sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:97)
at java.nio.file.Files.readAttributes(Files.java:1684)
at
org.apache.hadoop.fs.RawLocalFileSystem$DeprecatedRawLocalFileStatus.<init>(RawLocalFileSystem.java:656)
at
org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:637)
at
org.apache.hadoop.fs.RawLocalFileSystem.getFileLinkStatusInternal(RawLocalFileSystem.java:853)
at
org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:630)
at
org.apache.hadoop.fs.DelegateToFileSystem.getFileStatus(DelegateToFileSystem.java:110)
at org.apache.hadoop.fs.FilterFs.getFileStatus(FilterFs.java:121)
at org.apache.hadoop.fs.FileContext$15.next(FileContext.java:1163)
at org.apache.hadoop.fs.FileContext$15.next(FileContext.java:1159)
at org.apache.hadoop.fs.FSLinkResolver.resolve(FSLinkResolver.java:90)
at org.apache.hadoop.fs.FileContext.getFileStatus(FileContext.java:1159)
at org.apache.hadoop.fs.FileContext$Util.exists(FileContext.java:1624)
at
org.apache.hadoop.yarn.server.nodemanager.TestDeletionService.testAbsDelete(TestDeletionService.java:132)
{code}
> Need translate java.nio.file.NoSuchFileException to FileNotFoundException in
> DeprecatedRawLocalFileStatus constructor
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: HADOOP-12258
> URL: https://issues.apache.org/jira/browse/HADOOP-12258
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Reporter: zhihai xu
> Assignee: zhihai xu
> Priority: Blocker
>
> need translate java.nio.file.NoSuchFileException to FileNotFoundException in
> DeprecatedRawLocalFileStatus constructor.
> HADOOP-12045 adds nio to support access time, but nio will create
> java.nio.file.NoSuchFileException instead of FileNotFoundException.
> many hadoop codes depend on FileNotFoundException to decide whether a file
> exists. for example {{FileContext.util().exists()}}.
> {code}
> public boolean exists(final Path f) throws AccessControlException,
> UnsupportedFileSystemException, IOException {
> try {
> FileStatus fs = FileContext.this.getFileStatus(f);
> assert fs != null;
> return true;
> } catch (FileNotFoundException e) {
> return false;
> }
> }
> {code}
> same for {{FileSystem#exists}}
> {code}
> public boolean exists(Path f) throws IOException {
> try {
> return getFileStatus(f) != null;
> } catch (FileNotFoundException e) {
> return false;
> }
> }
> {code}
> NoSuchFileException will break these functions.
> Several test failures are caused by this issue:
> https://builds.apache.org/job/PreCommit-YARN-Build/8630/testReport/org.apache.hadoop.yarn.server.nodemanager/TestDeletionService/testRelativeDelete/
> https://builds.apache.org/job/PreCommit-YARN-Build/8632/testReport/org.apache.hadoop.yarn.server.nodemanager/TestDeletionService/testAbsDelete/
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)