You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by hu...@apache.org on 2018/05/23 22:07:41 UTC

[incubator-heron] branch huijunw/reorderzkclientdestructor created (now c0b3856)

This is an automated email from the ASF dual-hosted git repository.

huijun pushed a change to branch huijunw/reorderzkclientdestructor
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git.


      at c0b3856  reorder

This branch includes the following new commits:

     new c0b3856  reorder

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
huijun@apache.org.

[incubator-heron] 01/01: reorder

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

huijun pushed a commit to branch huijunw/reorderzkclientdestructor
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git

commit c0b3856adc79eddd21d5903efb9aa4f31292d80a
Author: Huijun Wu <hu...@twitter.com>
AuthorDate: Wed May 23 15:07:11 2018 -0700

    reorder
---
 heron/common/src/cpp/zookeeper/zkclient.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/heron/common/src/cpp/zookeeper/zkclient.cpp b/heron/common/src/cpp/zookeeper/zkclient.cpp
index c9750e4..f200d42 100644
--- a/heron/common/src/cpp/zookeeper/zkclient.cpp
+++ b/heron/common/src/cpp/zookeeper/zkclient.cpp
@@ -146,8 +146,12 @@ void ZKClient::Init() {
 
 // 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_;
 }
 
 //

-- 
To stop receiving notification emails like this one, please contact
huijun@apache.org.