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

Xiao Chen commented on HDFS-12754:
----------------------------------

Thanks Kuhu for the fix and others for the discussions.

I agree HDFS-12757 and this one is the same issue. Basically the 
{{DFSOutputStream}} object lock and the {{LeaseRenewer}} object lock can be 
held in reverse order by the a {{DFSOutputStream#close}} call and the 
{{LeaseRenewer#run}} thread. The fix here is to close the output streams out of 
the lease renewer lock, since the leaser renewer lock is just protecting the 
state of its member variables. LGTM overall.

Some comments:
- Checkstyle should be fixed.
- I would suggest to also polish the test a little bit, by using a more 
determined delay mechanism than {{Thread.sleep(3000)}}. Maybe we can also 
change the injector method from {{sleepWhenRenewLeaseTimeout}} to 
{{delayWhenRenewLeaseTimeout}}. (IMO the name {{sleepBeforeHedgedGet}} isn't a 
good example to follow)
- Please use a higher test timeout value like 2 mins, to be more robust when 
other deadly hdfs tests slow down jenkins machines.

> Lease renewal can hit a deadlock 
> ---------------------------------
>
>                 Key: HDFS-12754
>                 URL: https://issues.apache.org/jira/browse/HDFS-12754
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.8.1
>            Reporter: Kuhu Shukla
>            Assignee: Kuhu Shukla
>         Attachments: HDFS-12754.001.patch, HDFS-12754.002.patch, 
> HDFS-12754.003.patch, HDFS-12754.004.patch, HDFS-12754.005.patch, 
> HDFS-12754.006.patch, HDFS-12754.007.patch
>
>
> The Client and the renewer can hit a deadlock during close operation since 
> closeFile() reaches back to the DFSClient#removeFileBeingWritten. This is 
> possible if the client class close when the renewer is renewing a lease.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to