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 2f471de675 [fix](FileCache) load file cache before start up daemon 
threads (#17199)
2f471de675 is described below

commit 2f471de6750aee8e7b1c616c7a52b9f8b13dd510
Author: Ashin Gau <ashin...@users.noreply.github.com>
AuthorDate: Wed Mar 1 08:35:57 2023 +0800

    [fix](FileCache) load file cache before start up daemon threads (#17199)
    
    Daemon threads in doris_main.cpp will upload tablet metrics periodically, 
which will use StorageEngine::instance(). However loading file cache is a 
process in main thread, when it takes a lot of time to load file cache, 
StorageEngine::instance() will be a null pointer in daemon threads.
---
 be/src/service/doris_main.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp
index f0355f76c3..7ddf9d57ba 100644
--- a/be/src/service/doris_main.cpp
+++ b/be/src/service/doris_main.cpp
@@ -385,10 +385,6 @@ int main(int argc, char** argv) {
         }
     }
 
-    doris::Daemon daemon;
-    daemon.init(argc, argv, paths);
-    daemon.start();
-
     if (doris::config::enable_file_cache) {
         std::vector<doris::CachePath> cache_paths;
         olap_res = 
doris::parse_conf_cache_paths(doris::config::file_cache_path, cache_paths);
@@ -427,6 +423,11 @@ int main(int argc, char** argv) {
         }
     }
 
+    // Load file cache before starting up daemon threads to make sure 
StorageEngine is read.
+    doris::Daemon daemon;
+    daemon.init(argc, argv, paths);
+    daemon.start();
+
     doris::ResourceTls::init();
     if (!doris::BackendOptions::init()) {
         exit(-1);


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

Reply via email to