Repository: hadoop Updated Branches: refs/heads/HDFS-8707 53348cb33 -> 894e96241
HDFS-9486. Fix valgrind failures when using more than 1 io_service worker thread. Contributed by James Clampffer. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/894e9624 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/894e9624 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/894e9624 Branch: refs/heads/HDFS-8707 Commit: 894e962412271a5025ec57f86b9d86e7f9b5ce16 Parents: 53348cb Author: James <j...@apache.org> Authored: Mon Dec 7 14:54:22 2015 -0500 Committer: James <j...@apache.org> Committed: Mon Dec 7 14:54:22 2015 -0500 ---------------------------------------------------------------------- .../src/main/native/libhdfspp/lib/fs/filesystem.cc | 1 - .../src/main/native/libhdfspp/lib/fs/filesystem.h | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/894e9624/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc index d22dd51..1808b85 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc @@ -171,7 +171,6 @@ FileSystemImpl::~FileSystemImpl() { **/ io_service_->Stop(); worker_threads_.clear(); - io_service_.reset(nullptr); } void FileSystemImpl::Connect(const std::string &server, http://git-wip-us.apache.org/repos/asf/hadoop/blob/894e9624/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.h ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.h index cc8a8e1..772f93b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.h @@ -105,6 +105,11 @@ public: private: + /** + * The IoService must be the first member variable to ensure that it gets + * destroyed last. This allows other members to dequeue things from the + * service in their own destructors. + **/ std::unique_ptr<IoServiceImpl> io_service_; NameNodeOperations nn_; const std::string client_name_; @@ -120,8 +125,6 @@ private: std::vector<WorkerPtr> worker_threads_; }; - - } #endif