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

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new ba69ec0fbff branch-3.1: [enhancement](be) exit directly without 
deconstruct objects when not enable memleak check #55179 (#55485)
ba69ec0fbff is described below

commit ba69ec0fbffac3f1320346ce7aad01f71222d063
Author: yiguolei <[email protected]>
AuthorDate: Sat Aug 30 00:48:42 2025 +0800

    branch-3.1: [enhancement](be) exit directly without deconstruct objects 
when not enable memleak check #55179 (#55485)
    
    pick #55179
---
 be/src/common/config.cpp                                 |  2 ++
 be/src/common/config.h                                   |  2 ++
 be/src/service/doris_main.cpp                            | 11 ++++++++++-
 regression-test/pipeline/external/conf/be.conf           |  1 +
 regression-test/pipeline/nonConcurrent/conf/be.conf      |  1 +
 regression-test/pipeline/p0/conf/be.conf                 |  1 +
 regression-test/pipeline/p1/conf/be.conf                 |  1 +
 regression-test/pipeline/performance/conf/be_custom.conf |  1 +
 8 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index dcea82f3df5..b08b0cab45f 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1070,6 +1070,8 @@ DEFINE_Bool(enable_java_support, "true");
 // Set config randomly to check more issues in github workflow
 DEFINE_Bool(enable_fuzzy_mode, "false");
 
+DEFINE_Bool(enable_graceful_exit_check, "false");
+
 DEFINE_Bool(enable_debug_points, "false");
 
 DEFINE_Int32(pipeline_executor_size, "0");
diff --git a/be/src/common/config.h b/be/src/common/config.h
index d65047a7301..294b4cd5973 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1112,6 +1112,8 @@ DECLARE_Bool(enable_java_support);
 // Set config randomly to check more issues in github workflow
 DECLARE_Bool(enable_fuzzy_mode);
 
+DECLARE_Bool(enable_graceful_exit_check);
+
 DECLARE_Bool(enable_debug_points);
 
 DECLARE_Int32(pipeline_executor_size);
diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp
index 67c8e870e70..82dd7432674 100644
--- a/be/src/service/doris_main.cpp
+++ b/be/src/service/doris_main.cpp
@@ -615,6 +615,15 @@ int main(int argc, char** argv) {
 #endif
     // For graceful shutdown, need to wait for all running queries to stop
     exec_env->wait_for_all_tasks_done();
+
+    if (!doris::config::enable_graceful_exit_check) {
+        // If not in memleak check mode, no need to wait all objects 
de-constructed normally, just exit.
+        // It will make sure that graceful shutdown can be done definitely.
+        LOG(INFO) << "Doris main exited.";
+        google::FlushLogFiles(google::GLOG_INFO);
+        _exit(0); // Do not call exit(0), it will wait for all objects 
de-constructed normally
+        return 0;
+    }
     daemon.stop();
     flight_server.reset();
     LOG(INFO) << "Flight server stopped.";
@@ -634,7 +643,7 @@ int main(int argc, char** argv) {
     LOG(INFO) << "Backend Service stopped";
     exec_env->destroy();
     doris::ThreadLocalHandle::del_thread_local_if_count_is_zero();
-    LOG(INFO) << "Doris main exited.";
+    LOG(INFO) << "All service stopped, doris main exited.";
     return 0;
 }
 
diff --git a/regression-test/pipeline/external/conf/be.conf 
b/regression-test/pipeline/external/conf/be.conf
index 4e38d398899..93907c43982 100644
--- a/regression-test/pipeline/external/conf/be.conf
+++ b/regression-test/pipeline/external/conf/be.conf
@@ -70,3 +70,4 @@ crash_in_memory_tracker_inaccurate = true
 
 # This feature has bug, so by default is false, only open it in pipeline to 
observe
 enable_parquet_page_index=true
+enable_graceful_exit_check=true
diff --git a/regression-test/pipeline/nonConcurrent/conf/be.conf 
b/regression-test/pipeline/nonConcurrent/conf/be.conf
index 961756b2e71..ab4804c943d 100644
--- a/regression-test/pipeline/nonConcurrent/conf/be.conf
+++ b/regression-test/pipeline/nonConcurrent/conf/be.conf
@@ -87,4 +87,5 @@ large_cumu_compaction_task_min_thread_num=3
 
 # So feature has bug, so by default is false, only open it in pipeline to 
observe
 enable_parquet_page_index=true
+enable_graceful_exit_check=true
 
diff --git a/regression-test/pipeline/p0/conf/be.conf 
b/regression-test/pipeline/p0/conf/be.conf
index 264fded9dc6..0aecdd140d1 100644
--- a/regression-test/pipeline/p0/conf/be.conf
+++ b/regression-test/pipeline/p0/conf/be.conf
@@ -80,6 +80,7 @@ large_cumu_compaction_task_min_thread_num=3
 
 # This feature has bug, so by default is false, only open it in pipeline to 
observe
 enable_parquet_page_index=true
+enable_graceful_exit_check=true
 
 enable_fetch_rowsets_from_peer_replicas = true
 
diff --git a/regression-test/pipeline/p1/conf/be.conf 
b/regression-test/pipeline/p1/conf/be.conf
index 7d72127dc63..9e82774c0df 100644
--- a/regression-test/pipeline/p1/conf/be.conf
+++ b/regression-test/pipeline/p1/conf/be.conf
@@ -69,3 +69,4 @@ large_cumu_compaction_task_min_thread_num=3
 
 # This feature has bug, so by default is false, only open it in pipeline to 
observe
 enable_parquet_page_index=true
+enable_graceful_exit_check=true
diff --git a/regression-test/pipeline/performance/conf/be_custom.conf 
b/regression-test/pipeline/performance/conf/be_custom.conf
index d92d5204975..3ff6e6209b4 100644
--- a/regression-test/pipeline/performance/conf/be_custom.conf
+++ b/regression-test/pipeline/performance/conf/be_custom.conf
@@ -24,3 +24,4 @@ streaming_load_max_mb=102400
 
 # This feature has bug, so by default is false, only open it in pipeline to 
observe
 enable_parquet_page_index=true
+enable_graceful_exit_check=true
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to