From f76f47932f0c4f3c435fd1d9af4d189c1dd71577 Mon Sep 17 00:00:00 2001 From: bed debug Date: Wed, 25 Mar 2020 15:49:53 -0700 Subject: [PATCH] fixstmgrcrash (#3492) Co-authored-by: Huijun Wu --- heron/stmgr/src/cpp/manager/stmgr-clientmgr.cpp | 4 ++-- heron/stmgr/src/cpp/manager/stmgr-clientmgr.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/heron/stmgr/src/cpp/manager/stmgr-clientmgr.cpp b/heron/stmgr/src/cpp/manager/stmgr-clientmgr.cpp index f2cb4eac84e..787a0d61e02 100644 --- a/heron/stmgr/src/cpp/manager/stmgr-clientmgr.cpp +++ b/heron/stmgr/src/cpp/manager/stmgr-clientmgr.cpp @@ -115,7 +115,7 @@ bool StMgrClientMgr::DidAnnounceBackPressure() { return stream_manager_->DidAnnounceBackPressure(); } -shared_ptr StMgrClientMgr::CreateClient(const sp_string& _other_stmgr_id, +StMgrClient* StMgrClientMgr::CreateClient(const sp_string& _other_stmgr_id, const sp_string& _hostname, sp_int32 _port) { stmgr_clientmgr_metrics_->scope(METRIC_STMGR_NEW_CONNECTIONS)->incr(); NetworkOptions options; @@ -126,7 +126,7 @@ shared_ptr StMgrClientMgr::CreateClient(const sp_string& _other_stm options.set_high_watermark(high_watermark_); options.set_low_watermark(low_watermark_); options.set_socket_family(PF_INET); - auto client = make_shared(eventLoop_, options, topology_name_, topology_id_, + StMgrClient* client = new StMgrClient(eventLoop_, options, topology_name_, topology_id_, stmgr_id_, _other_stmgr_id, this, metrics_manager_client_, droptuples_upon_backpressure_); client->Start(); diff --git a/heron/stmgr/src/cpp/manager/stmgr-clientmgr.h b/heron/stmgr/src/cpp/manager/stmgr-clientmgr.h index 3a5a75f8ad1..3e3fdf41a15 100644 --- a/heron/stmgr/src/cpp/manager/stmgr-clientmgr.h +++ b/heron/stmgr/src/cpp/manager/stmgr-clientmgr.h @@ -79,11 +79,11 @@ class StMgrClientMgr { virtual bool AllStMgrClientsRegistered(); private: - shared_ptr CreateClient(const sp_string& _other_stmgr_id, + StMgrClient* CreateClient(const sp_string& _other_stmgr_id, const sp_string& _host_name, sp_int32 _port); // map of stmgrid to its client - std::unordered_map> clients_; + std::unordered_map clients_; sp_string topology_name_; sp_string topology_id_;