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

James Clampffer commented on HDFS-13615:
----------------------------------------

[~mtracy] Nice!  We've had to do similar things elsewhere due to lambdas not 
capturing things they depend on. +1.  I'll commit shortly.

This patch can end up causing an IoService thread to attempt to join with 
itself: the lambda props up the lifetime of the SaslProtocol, which holds a 
shared_ptr to the RpcEngine which in turn holds a shared_ptr to the IoService.  
If the lambda is the last thing holding the refcount > 0 then those destructors 
get run in an ioservice thread, and the ioservice destructor tries to join all 
ioservice threads.  Your fix is still an improvement as the destruction order 
issues had already been around.  Those can be addressed in another jira.

> libhdfs++ SaslProtocol hanging while accessing invalid lock
> -----------------------------------------------------------
>
>                 Key: HDFS-13615
>                 URL: https://issues.apache.org/jira/browse/HDFS-13615
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Mitchell Tracy
>            Assignee: Mitchell Tracy
>            Priority: Major
>         Attachments: HDFS-13615.000.patch
>
>
> During certain race conditions, it is possible to have an asio thread that 
> wakes up to process a response, but the RpcConnection to which this 
> SaslProtocol belongs is dead.
> This can happen as a result of the filesystem being destroyed in the middle 
> of a sasl handshake.
> Therefore, we should explicitly capture the RpcConnection in the lambda to 
> ensure its existence when the SaslProtocol wakes up to process the server's 
> response. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to