xy720 commented on a change in pull request #3945:
URL: https://github.com/apache/incubator-doris/pull/3945#discussion_r446637336



##########
File path: be/src/olap/file_helper.cpp
##########
@@ -44,9 +45,19 @@ FileHandler::FileHandler() :
         _is_using_cache(false),
         _cache_handle(NULL) {
     static std::once_flag once_flag;
-    std::call_once(once_flag, [] {
-        _s_fd_cache = new_lru_cache(config::file_descriptor_cache_capacity);
-    });
+    #ifdef BE_TEST
+        std::call_once(once_flag, [] {
+            _s_fd_cache = 
new_lru_cache(config::file_descriptor_cache_capacity);
+        });
+    #else
+        // storage engine may not be opened when doris try to read and write 
+        // temp file under the storage root path. So we need to check it.
+        if (StorageEngine::instance() != nullptr) {

Review comment:
       Thanks for advices! For problem 1, we can further check weather 
StorageEngine::instance()->file_cache() == nullptr.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to