commit | eb86d548833f19c70587af9d8d981a2792b49e63 | [log] [tgz] |
---|---|---|
author | Huijun Wu <huijunw@twitter.com> | Tue May 29 12:35:16 2018 -0700 |
committer | Huijun Wu <huijunw@twitter.com> | Tue May 29 12:35:16 2018 -0700 |
tree | fc5a40a92bb3692801fe30d1f94a98c472622f00 | |
parent | 1aa2aa697aa48ba5fb22f22b077a66896df41397 [diff] |
sync https://github.com/apache/incubator-heron/pull/2908
diff --git a/heron/common/src/cpp/zookeeper/zkclient.cpp b/heron/common/src/cpp/zookeeper/zkclient.cpp index 6633520..ee74db4 100644 --- a/heron/common/src/cpp/zookeeper/zkclient.cpp +++ b/heron/common/src/cpp/zookeeper/zkclient.cpp
@@ -143,8 +143,12 @@ // Destructor. ZKClient::~ZKClient() { - delete piper_; zookeeper_close(zk_handle_); + // zookeeper_close() depends on piper_ + // when HeronZKStateMgr::GlobalWatchEventHandler() and GetCompletionWatcher + // are called at the same time in two threads, + // thus `delete piper_` after zookeeper_close() joins all zk_client threads. + delete piper_; } //