You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Igor Bolotin (JIRA)" <ji...@apache.org> on 2006/04/15 05:40:00 UTC

[jira] Created: (HADOOP-139) Deadlock in LocalFileSystem lock/release

Deadlock in LocalFileSystem lock/release 
-----------------------------------------

         Key: HADOOP-139
         URL: http://issues.apache.org/jira/browse/HADOOP-139
     Project: Hadoop
        Type: Bug

  Components: fs  
    Reporter: Igor Bolotin


LocalFileSystem lock/release methods marked synchronized and inside they lock file channel - this produces deadlock situation. Let's see how it happens: 
1. First thread locks the file and starts some long-running process.
2. Second thread tries to lock the file and it blocks inside channel lock method. It  keeps LocalFileSystem instance "locked" as well. 
3. First thread finished it's processing and tries to release lock - it blocks because LocalFileSystem instance is "locked" by second thread - both threads are waiting to each other. 


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HADOOP-139) Deadlock in LocalFileSystem lock/release

Posted by "Igor Bolotin (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-139?page=all ]

Igor Bolotin updated HADOOP-139:
--------------------------------

    Attachment: deadlock.patch

Attached is proposed patch. I removed entire lock/release method synchronization and replaced it with critical section synchronization for sets accesses - leaving channel lock/release calls outside of synchronized statement. 

> Deadlock in LocalFileSystem lock/release
> ----------------------------------------
>
>          Key: HADOOP-139
>          URL: http://issues.apache.org/jira/browse/HADOOP-139
>      Project: Hadoop
>         Type: Bug

>   Components: fs
>     Reporter: Igor Bolotin
>  Attachments: deadlock.patch
>
> LocalFileSystem lock/release methods marked synchronized and inside they lock file channel - this produces deadlock situation. Let's see how it happens: 
> 1. First thread locks the file and starts some long-running process.
> 2. Second thread tries to lock the file and it blocks inside channel lock method. It  keeps LocalFileSystem instance "locked" as well. 
> 3. First thread finished it's processing and tries to release lock - it blocks because LocalFileSystem instance is "locked" by second thread - both threads are waiting to each other. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HADOOP-139) Deadlock in LocalFileSystem lock/release

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-139?page=comments#action_12374983 ] 

Doug Cutting commented on HADOOP-139:
-------------------------------------

I just committed this.  Thanks, Igor!

The patch did not apply directly, due to other changes made to Hadoop since you contributed it.  So I had to apply parts of it manually.  Please check that it still looks correct.  Thanks!

> Deadlock in LocalFileSystem lock/release
> ----------------------------------------
>
>          Key: HADOOP-139
>          URL: http://issues.apache.org/jira/browse/HADOOP-139
>      Project: Hadoop
>         Type: Bug

>   Components: fs
>     Reporter: Igor Bolotin
>  Attachments: deadlock.patch
>
> LocalFileSystem lock/release methods marked synchronized and inside they lock file channel - this produces deadlock situation. Let's see how it happens: 
> 1. First thread locks the file and starts some long-running process.
> 2. Second thread tries to lock the file and it blocks inside channel lock method. It  keeps LocalFileSystem instance "locked" as well. 
> 3. First thread finished it's processing and tries to release lock - it blocks because LocalFileSystem instance is "locked" by second thread - both threads are waiting to each other. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (HADOOP-139) Deadlock in LocalFileSystem lock/release

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-139?page=all ]
     
Doug Cutting resolved HADOOP-139:
---------------------------------

    Fix Version: 0.2
     Resolution: Fixed
      Assign To: Doug Cutting

> Deadlock in LocalFileSystem lock/release
> ----------------------------------------
>
>          Key: HADOOP-139
>          URL: http://issues.apache.org/jira/browse/HADOOP-139
>      Project: Hadoop
>         Type: Bug

>   Components: fs
>     Reporter: Igor Bolotin
>     Assignee: Doug Cutting
>      Fix For: 0.2
>  Attachments: deadlock.patch
>
> LocalFileSystem lock/release methods marked synchronized and inside they lock file channel - this produces deadlock situation. Let's see how it happens: 
> 1. First thread locks the file and starts some long-running process.
> 2. Second thread tries to lock the file and it blocks inside channel lock method. It  keeps LocalFileSystem instance "locked" as well. 
> 3. First thread finished it's processing and tries to release lock - it blocks because LocalFileSystem instance is "locked" by second thread - both threads are waiting to each other. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira