You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Yi Liu (JIRA)" <ji...@apache.org> on 2014/09/11 10:54:34 UTC
[jira] [Commented] (HDFS-7045) Fix deadlock of open file (in some
cases)
[ https://issues.apache.org/jira/browse/HDFS-7045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14129795#comment-14129795 ]
Yi Liu commented on HDFS-7045:
------------------------------
Will attach the patch later.
> Fix deadlock of open file (in some cases)
> -----------------------------------------
>
> Key: HDFS-7045
> URL: https://issues.apache.org/jira/browse/HDFS-7045
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: namenode
> Reporter: Yi Liu
> Assignee: Yi Liu
> Priority: Critical
>
> There will be deadlock for current logic as following ({{resolvePath}} could throw exception, then deadlock):
> In {{FSNamesystem#getBlockLocationsUpdateTimes}}:
> {code}
> ...
> if (isReadOp) { // first attempt is with readlock
> checkOperation(OperationCategory.READ);
> readLock();
> } else { // second attempt is with write lock
> checkOperation(OperationCategory.WRITE);
> writeLock(); // writelock is needed to set accesstime
> }
> src = resolvePath(src, pathComponents);
> try {
> ...
> } finally {
> if (isReadOp) {
> readUnlock();
> } else {
> writeUnlock();
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)