[
https://issues.apache.org/jira/browse/HDFS-2484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14519728#comment-14519728
]
Konstantin Shvachko commented on HDFS-2484:
-------------------------------------------
Rakesh, if you look further down in {{checkLease()}} you see
{code}
if (isFileDeleted(file)) {
throw new FileNotFoundException(src);
}
{code}
I don't think this code path is ever triggered except probably when {{src}} is
deleted while in a snapshot, which will be inconsistent with the regular case
(deletion without a snapshot), as the latter will throw LeaseExpiredException.
I am just saying {{FileNotFoundException}} is a more appropriate message for
the client, since lease expiration is a consequence of file being deleted, so
why not report just that.
> checkLease should throw FileNotFoundException when file does not exist
> ----------------------------------------------------------------------
>
> Key: HDFS-2484
> URL: https://issues.apache.org/jira/browse/HDFS-2484
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: namenode
> Affects Versions: 0.22.0, 2.0.0-alpha
> Reporter: Konstantin Shvachko
>
> When file is deleted during its creation {{FSNamesystem.checkLease(String
> src, String holder)}} throws {{LeaseExpiredException}}. It would be more
> informative if it thrown {{FileNotFoundException}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)