From bea9f58950be873efd339835616e3d3499d7e45a Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 1 Jul 2025 11:12:30 +0200 Subject: just-mr: Fix lifetime of Git CAS lock If calling just, the shared Git CAS lock, if taken, now lasts past the exec call, the same way as the CAS lock does, in order to prevent any rotation taking place in between. --- src/other_tools/just_mr/launch.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp index c085f5be..b1b918b2 100644 --- a/src/other_tools/just_mr/launch.cpp +++ b/src/other_tools/just_mr/launch.cpp @@ -91,13 +91,15 @@ auto CallJust(std::optional const& config_file, std::optional> mr_config_pair{ std::nullopt}; + // If gc locks are needed, ensure to keep them alive also for the exec call std::optional lock{}; + std::optional repo_lock{}; + if (subcommand and kKnownJustSubcommands.contains(*subcommand)) { auto const& flags = kKnownJustSubcommands.at(*subcommand); // Read the config file if needed if (flags.config) { - auto repo_lock = - RepositoryGarbageCollector::SharedLock(storage_config); + repo_lock = RepositoryGarbageCollector::SharedLock(storage_config); if (not repo_lock) { return kExitGenericFailure; } -- cgit v1.2.3