[
https://issues.apache.org/jira/browse/HDFS-10740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15415660#comment-15415660
]
James Clampffer commented on HDFS-10740:
----------------------------------------
Thanks for updating the patch [~anatoli.shein].
Not sure how I missed it yesterday but you'll want to add a lock around access
to the futures vector.
{code}
//Save this future to the vector of futures which will be used to wait on all
promises
//after the whole recursion is done
futures.push_back(move(future));
{code}
This is unsafe if the io_service is running with more than one thread. Single
thread is the default now but adding a lock will prevent this from breaking if
that changes in the future.
I'll +1 and commit if you make that change and it gets a passing CI test (or
let me know if I'm wrong about the thread safety thing).
> libhdfs++: Implement recursive directory generator
> --------------------------------------------------
>
> Key: HDFS-10740
> URL: https://issues.apache.org/jira/browse/HDFS-10740
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: hdfs-client
> Reporter: Anatoli Shein
> Assignee: Anatoli Shein
> Attachments: HDFS-10740.HDFS-8707.000.patch,
> HDFS-10740.HDFS-8707.001.patch
>
>
> This tool will allow us do benchmarking/testing our find functionality, and
> will be a good example showing how to call a large number or namenode
> operations reqursively.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]