This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 9102df07c10 [enhancement](be) exit directly without deconstruct
objects when not enable memleak check (#55179)
9102df07c10 is described below
commit 9102df07c10fe7b0c1099152d1540cfe990b767b
Author: yiguolei <[email protected]>
AuthorDate: Fri Aug 29 18:44:54 2025 +0800
[enhancement](be) exit directly without deconstruct objects when not enable
memleak check (#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 b1f2cde68d4..4d124852511 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1081,6 +1081,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 d2e869c9193..6cac835983c 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1113,6 +1113,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 08fdeaa7c35..401456c6f3a 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.";
@@ -633,7 +642,7 @@ int main(int argc, char** argv) {
service.reset();
LOG(INFO) << "Backend Service stopped";
exec_env->destroy();
- 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 8bb35249ae6..122662a44fe 100644
--- a/regression-test/pipeline/external/conf/be.conf
+++ b/regression-test/pipeline/external/conf/be.conf
@@ -71,3 +71,4 @@ crash_in_memory_tracker_inaccurate = true
# 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/nonConcurrent/conf/be.conf
b/regression-test/pipeline/nonConcurrent/conf/be.conf
index 5b1d5600b64..d744437a1b7 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 adb1e0db5cc..a64c5aa91f3 100644
--- a/regression-test/pipeline/p0/conf/be.conf
+++ b/regression-test/pipeline/p0/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/p1/conf/be.conf
b/regression-test/pipeline/p1/conf/be.conf
index 9eccc8e51bc..73453ebb61a 100644
--- a/regression-test/pipeline/p1/conf/be.conf
+++ b/regression-test/pipeline/p1/conf/be.conf
@@ -73,3 +73,4 @@ enable_batch_download = true
# 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/performance/conf/be_custom.conf
b/regression-test/pipeline/performance/conf/be_custom.conf
index 359480b7912..08b91280a53 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
# 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
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]