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

Anatoli Shein commented on HDFS-13745:
--------------------------------------

Thanks for the patch [~James C]!  I have just a few questions about this:
1. Is there a possibility that some task executed by the IoService will run 
forever? Should we add some timeout in BlockingStop method if we have been 
waiting too long?
2. In the hdfs_ioservice_test in longRunningCallback we sleep for just 1 
second, which might not be enough since if there is some sort of system delay 
longer than 1 second the test might fail. Even though with any amount of sleep 
there is a chance of this happening, it might make sense to increase it to 2-3 
seconds.

> libhdfs++: Fix race in FileSystem destructor
> --------------------------------------------
>
>                 Key: HDFS-13745
>                 URL: https://issues.apache.org/jira/browse/HDFS-13745
>             Project: Hadoop HDFS
>          Issue Type: Task
>          Components: native
>            Reporter: James Clampffer
>            Assignee: James Clampffer
>            Priority: Major
>         Attachments: HDFS-13745.000.patch
>
>
> Whatever happens to have the last shared_ptr to the IoService will run 
> ~IoService when the shared_ptr goes out of scope.  IoService's destructor is 
> responsible for joining all worker threads in the pool.  Most callbacks now 
> own weak_ptr<IoService> that can be promoted to a shared_ptr in order to post 
> new async tasks.  If a callback object is the last thing holding the 
> IoService shared_ptr it's going to try to join the thread pool inside of one 
> of the thread pool's threads.



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

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

Reply via email to