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

dataroaring 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 2f29dda5aa5 [Fix](core) Fix file system scan deleted file (#29266)
2f29dda5aa5 is described below

commit 2f29dda5aa5ef236910541b351fda5d35e2463c7
Author: abmdocrt <yukang.lian2...@gmail.com>
AuthorDate: Fri Dec 29 09:07:59 2023 +0800

    [Fix](core) Fix file system scan deleted file (#29266)
---
 be/src/io/fs/local_file_system.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/be/src/io/fs/local_file_system.cpp 
b/be/src/io/fs/local_file_system.cpp
index d7e1372ffe9..78ba222d1ff 100644
--- a/be/src/io/fs/local_file_system.cpp
+++ b/be/src/io/fs/local_file_system.cpp
@@ -32,6 +32,7 @@
 #include <system_error>
 #include <utility>
 
+#include "common/exception.h"
 #include "gutil/macros.h"
 #include "io/fs/err_utils.h"
 #include "io/fs/file_system.h"
@@ -182,7 +183,11 @@ Status LocalFileSystem::directory_size(const Path& 
dir_path, size_t* dir_size) {
     if (std::filesystem::exists(dir_path) && 
std::filesystem::is_directory(dir_path)) {
         for (const auto& entry : 
std::filesystem::recursive_directory_iterator(dir_path)) {
             if (std::filesystem::is_regular_file(entry)) {
-                *dir_size += std::filesystem::file_size(entry);
+                try {
+                    *dir_size += std::filesystem::file_size(entry);
+                } catch (const std::exception& e) {
+                    LOG(INFO) << "{}", e.what();
+                }
             }
         }
         return Status::OK();


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

Reply via email to