[
https://issues.apache.org/jira/browse/HDFS-12427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16410478#comment-16410478
]
Hudson commented on HDFS-12427:
-------------------------------
SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #13869 (See
[https://builds.apache.org/job/Hadoop-trunk-Commit/13869/])
HDFS-12427: libhdfs++: Prevent requests from holding dangling pointer to
(james.clampffer: rev fc5e44d9edeaad9c1381a46fb370b167ac6250b1)
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection_impl.cc
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/namenode_operations.cc
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection.h
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/namenode_operations.h
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_connection_impl.h
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.h
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/proto/protoc_gen_hrpc.cc
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.h
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/rpc_engine_test.cc
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/request.h
* (edit)
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/request.cc
> libhdfs++: Prevent Requests from holding dangling pointer to RpcEngine
> ----------------------------------------------------------------------
>
> Key: HDFS-12427
> URL: https://issues.apache.org/jira/browse/HDFS-12427
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: hdfs-client
> Reporter: James Clampffer
> Assignee: James Clampffer
> Priority: Critical
> Attachments: HDFS-12427.HDFS-8707.000.patch,
> HDFS-12427.HDFS-8707.001.patch, HDFS-12427.HDFS-8707.002.patch,
> HDFS-12427.HDFS-8707.003.patch, HDFS-12427.HDFS-8707.004.patch
>
>
> The lifetime of Request objects is tied to the worker thread(s) in the async
> event loop. In the current code there's nothing that prevents a request from
> outliving the RpcEngine (bound to FileSystem) while it's waiting for IO. If
> the Request, or a task that makes a new request, outlives the RpcEngine it
> attempts to dereference a dangling pointer and either crashes or continues to
> run with bad data.
> Proposed fix is to reference count the RpcEngine via shared_ptr so that
> Requests can hold a weak_ptr to it. When a request or RpcConnection
> attempting to make a request needs something from the RpcEngine like a call
> id number it can promote the weak_ptr to a shared_ptr. If it's unable to
> promote because the RpcEngine has been destroyed the Request's handler can be
> invoked with an appropriate error message. A weak_ptr must be used rather
> than a shared_ptr to avoid reference cycles.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]