diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-28 13:25:31 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-29 09:09:26 +0200 |
commit | 9a23629ff179c16309c7cfdb898926be03e8b105 (patch) | |
tree | 5af2e48bcdb1fe8685cbb374d313d05730ade488 /src/other_tools/root_maps | |
parent | ded2fe967269c892d8691e0e405a4adc4c4358f4 (diff) | |
download | justbuild-9a23629ff179c16309c7cfdb898926be03e8b105.tar.gz |
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.
Diffstat (limited to 'src/other_tools/root_maps')
-rw-r--r-- | src/other_tools/root_maps/TARGETS | 2 | ||||
-rw-r--r-- | src/other_tools/root_maps/content_git_map.cpp | 20 | ||||
-rw-r--r-- | src/other_tools/root_maps/fpath_git_map.cpp | 20 |
3 files changed, 0 insertions, 42 deletions
diff --git a/src/other_tools/root_maps/TARGETS b/src/other_tools/root_maps/TARGETS index d4d1e4ba..49e1ee60 100644 --- a/src/other_tools/root_maps/TARGETS +++ b/src/other_tools/root_maps/TARGETS @@ -88,7 +88,6 @@ , ["src/buildtool/execution_api/local", "config"] , ["src/buildtool/file_system", "file_root"] , ["src/buildtool/file_system", "git_repo"] - , ["src/buildtool/multithreading", "async_map_utils"] , ["src/buildtool/multithreading", "task_system"] , ["src/buildtool/storage", "fs_utils"] , ["src/other_tools/git_operations", "git_repo_remote"] @@ -122,7 +121,6 @@ , ["src/buildtool/file_system", "file_storage"] , ["src/buildtool/file_system", "git_repo"] , ["src/buildtool/file_system/symlinks_map", "pragma_special"] - , ["src/buildtool/multithreading", "async_map_utils"] , ["src/buildtool/multithreading", "task_system"] , ["src/buildtool/storage", "fs_utils"] , ["src/other_tools/git_operations", "git_repo_remote"] diff --git a/src/other_tools/root_maps/content_git_map.cpp b/src/other_tools/root_maps/content_git_map.cpp index f46e3940..d39a70e5 100644 --- a/src/other_tools/root_maps/content_git_map.cpp +++ b/src/other_tools/root_maps/content_git_map.cpp @@ -18,7 +18,6 @@ #include "src/buildtool/file_system/file_root.hpp" #include "src/buildtool/file_system/file_storage.hpp" #include "src/buildtool/file_system/symlinks_map/pragma_special.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/root_maps/root_utils.hpp" @@ -234,25 +233,6 @@ void ResolveContentTree( 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 = { 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 = { |