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

kxiao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 8dac29c14d7 [fix](dns-cache) do not detach the refresh thread (#33182)
8dac29c14d7 is described below

commit 8dac29c14d723b9d69ba26918e23994a686b08d4
Author: Mingyu Chen <morning...@163.com>
AuthorDate: Wed Apr 3 09:21:57 2024 +0800

    [fix](dns-cache) do not detach the refresh thread (#33182)
---
 be/src/runtime/exec_env_init.cpp | 4 +++-
 be/src/util/dns_cache.cpp        | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/be/src/runtime/exec_env_init.cpp b/be/src/runtime/exec_env_init.cpp
index 056466dd4be..c44605dc845 100644
--- a/be/src/runtime/exec_env_init.cpp
+++ b/be/src/runtime/exec_env_init.cpp
@@ -597,7 +597,6 @@ void ExecEnv::destroy() {
     _delta_writer_v2_pool.reset();
     _load_stream_stub_pool.reset();
     _file_cache_open_fd_cache.reset();
-    SAFE_DELETE(_dns_cache);
 
     // StorageEngine must be destoried before _page_no_cache_mem_tracker.reset 
and _cache_manager destory
     // shouldn't use SAFE_STOP. otherwise will lead to twice stop.
@@ -689,6 +688,9 @@ void ExecEnv::destroy() {
     // We should free task scheduler finally because task queue / scheduler 
maybe used by pipelineX.
     SAFE_DELETE(_without_group_task_scheduler);
 
+    // dns cache is a global instance and need to be released at last
+    SAFE_DELETE(_dns_cache);
+
     _s_tracking_memory = false;
     LOG(INFO) << "Doris exec envorinment is destoried.";
 }
diff --git a/be/src/util/dns_cache.cpp b/be/src/util/dns_cache.cpp
index f2bd4ce91e6..fc7e88b3c1c 100644
--- a/be/src/util/dns_cache.cpp
+++ b/be/src/util/dns_cache.cpp
@@ -24,7 +24,6 @@ namespace doris {
 
 DNSCache::DNSCache() {
     refresh_thread = std::thread(&DNSCache::_refresh_cache, this);
-    refresh_thread.detach();
 }
 
 DNSCache::~DNSCache() {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to