From 55ba09ec97d2449b39d7fcc38c346969168d899b Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Mon, 27 Feb 2023 10:27:52 +0100 Subject: execution service: implement WaitExecution and google::longrunning::Operations::GetOperation For each action that is executed, an entry is added to a shared thread safe cache. Once the number of operations stored exceeds twice 2^n, where n is given by the option --log-operations-threshold, at most 2^n operations will be removed, in a FIFO scheme. --- src/buildtool/execution_api/execution_service/ac_server.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/buildtool/execution_api/execution_service/ac_server.cpp') diff --git a/src/buildtool/execution_api/execution_service/ac_server.cpp b/src/buildtool/execution_api/execution_service/ac_server.cpp index 16dbdf3b..8746a0cd 100644 --- a/src/buildtool/execution_api/execution_service/ac_server.cpp +++ b/src/buildtool/execution_api/execution_service/ac_server.cpp @@ -15,7 +15,6 @@ #include "src/buildtool/execution_api/execution_service/ac_server.hpp" #include "fmt/format.h" -#include "src/buildtool/compatibility/native_support.hpp" #include "src/buildtool/execution_api/local/garbage_collector.hpp" auto ActionCacheServiceImpl::GetActionResult( @@ -24,7 +23,7 @@ auto ActionCacheServiceImpl::GetActionResult( ::bazel_re::ActionResult* response) -> ::grpc::Status { logger_.Emit(LogLevel::Trace, "GetActionResult: {}", - NativeSupport::Unprefix(request->action_digest().hash())); + request->action_digest().hash()); auto lock = GarbageCollector::SharedLock(); if (!lock) { auto str = fmt::format("Could not acquire SharedLock"); @@ -33,10 +32,9 @@ auto ActionCacheServiceImpl::GetActionResult( } auto x = ac_.CachedResult(request->action_digest()); if (!x) { - return grpc::Status{grpc::StatusCode::NOT_FOUND, - fmt::format("{} missing from AC", - NativeSupport::Unprefix( - request->action_digest().hash()))}; + return grpc::Status{ + grpc::StatusCode::NOT_FOUND, + fmt::format("{} missing from AC", request->action_digest().hash())}; } *response = *x; return ::grpc::Status::OK; -- cgit v1.2.3