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 "Carrey Zhan (JIRA)" <ji...@apache.org> on 2014/10/15 12:03:34 UTC

[jira] [Commented] (HDFS-7253) getBlockLocationsUpdateTimes missing handle exception may cause fsLock dead lock

    [ https://issues.apache.org/jira/browse/HDFS-7253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14172217#comment-14172217 ] 

Carrey Zhan commented on HDFS-7253:
-----------------------------------

I checked all the operations about FSNamesystem.fsLock.readLock, and find that there is a line between readLock()/writeLock and try-finnaly block.
{code:java}
      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 = FSDirectory.resolvePath(src, pathComponents, dir);
      try {
{code}

The function FSDirectory.resolvePath may throw a FileNotFoundException, cause the previously acquired lock not released.

And I do found the logs of FileNotFoundException, about 2 minutes before no useful logs appending to log files.

> getBlockLocationsUpdateTimes missing handle exception may cause fsLock dead lock
> --------------------------------------------------------------------------------
>
>                 Key: HDFS-7253
>                 URL: https://issues.apache.org/jira/browse/HDFS-7253
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 2.2.0
>            Reporter: Carrey Zhan
>
> One day my active namenode hanged and I dumped the program stacks by jstack.In the stacks file, I saw most threads were waiting FSNamesystem.fsLock, both  readLock and writeLock were unacquirable, but no thread was holding writeLock.
> I tried to access the web interface of this namenode but was blocked. and I tried to failover the active node to another namenode manually (zkfs did not discover this node was hanging) but it was also failed. So I killed this namenode trying to recover the production environment, then the failover was triggered, standby nn transited to active, and then, the new active namenode hanged.
> My following steps are useless and can be ignored. At last, I thought it was caused by an incorrect lock handling in FSNamesystem.getBlockLocationsUpdateTimes, which I will describe in the first comment.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)