From 9a23629ff179c16309c7cfdb898926be03e8b105 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 28 Aug 2024 13:25:31 +0200 Subject: just-mr maps: Properly check for missing values in map chain The root async map in a chain of calls should always be checked for missing value, which can happen if, e.g., a cycle happens or a thread gets killed by the system. Properly handle this by checking explicitly if a value has been posted. If not, check for cycles where it makes sense (for example, in the resolving of symlinks), otherwise report any pending map keys not yet processed. This is done for all just-mr commands working with async maps. --- src/other_tools/root_maps/fpath_git_map.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/other_tools/root_maps/fpath_git_map.cpp') diff --git a/src/other_tools/root_maps/fpath_git_map.cpp b/src/other_tools/root_maps/fpath_git_map.cpp index 37b0c543..dbda05ce 100644 --- a/src/other_tools/root_maps/fpath_git_map.cpp +++ b/src/other_tools/root_maps/fpath_git_map.cpp @@ -20,7 +20,6 @@ #include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/file_system/git_repo.hpp" -#include "src/buildtool/multithreading/async_map_utils.hpp" #include "src/buildtool/multithreading/task_system.hpp" #include "src/buildtool/storage/fs_utils.hpp" #include "src/other_tools/git_operations/git_repo_remote.hpp" @@ -151,25 +150,6 @@ void ResolveFilePathTree( ts, ws_setter, logger](auto const& hashes) { - if (not hashes[0]) { - // check for cycles - if (auto error = DetectAndReportCycle( - fmt::format("resolving Git tree {}", tree_hash), - *resolve_symlinks_map, - kGitObjectToResolvePrinter)) { - (*logger)(fmt::format("Failed to resolve symlinks " - "in tree {}:\n{}", - tree_hash, - *error), - /*fatal=*/true); - return; - } - (*logger)(fmt::format("Unknown error in resolving " - "symlinks in tree {}", - tree_hash), - /*fatal=*/true); - return; - } auto const& resolved_tree_id = hashes[0]->id; // keep tree alive in Git cache via a tagged commit GitOpKey op_key = { -- cgit v1.2.3