diff --git a/be/src/runtime/block_spill_manager.cpp b/be/src/runtime/block_spill_manager.cpp index ad0d711c809f742..f8ee203702c2249 100644 --- a/be/src/runtime/block_spill_manager.cpp +++ b/be/src/runtime/block_spill_manager.cpp @@ -70,6 +70,11 @@ void BlockSpillManager::gc(int64_t max_file_count) { for (const auto& path : _store_paths) { std::string gc_root_dir = fmt::format("{}/{}", path.path, BLOCK_SPILL_GC_DIR); + std::error_code ec; + exists = std::filesystem::exists(gc_root_dir, ec); + if (ec || !exists) { + continue; + } std::vector dirs; auto st = io::global_local_filesystem()->list(gc_root_dir, false, &dirs, &exists); if (!st.ok()) {