[ https://issues.apache.org/jira/browse/HDFS-7045?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yi Liu updated HDFS-7045: ------------------------- Description: {{resolvePath}} could throw exception in following case, then deadlock. * open file under path {{/.reserved/raw}} using a non super user. * open file under path {{/.reserved/.inodes}}. {{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} was: {{resolvePath}} could throw exception in following case, then deadlock. * open file under path {{/.reserved/raw}} using a non super user. * open file under patch {{/.reserved/.inodes}} {{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} > 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 > > {{resolvePath}} could throw exception in following case, then deadlock. > * open file under path {{/.reserved/raw}} using a non super user. > * open file under path {{/.reserved/.inodes}}. > {{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)