hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yi Liu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-7045) Fix deadlock of open file (in some cases)
Date Thu, 11 Sep 2014 08:53:34 GMT
Yi Liu created HDFS-7045:
----------------------------

             Summary: 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)

Mime
View raw message