diff options
author | Alberto Sartori <alberto.sartori@huawei.com> | 2023-02-27 10:27:52 +0100 |
---|---|---|
committer | Alberto Sartori <alberto.sartori@huawei.com> | 2023-03-10 09:38:39 +0100 |
commit | 55ba09ec97d2449b39d7fcc38c346969168d899b (patch) | |
tree | 4c97affeaae2e5bb88a41be6d389b2502bae6e24 /src/buildtool/execution_api/execution_service/ac_server.cpp | |
parent | 117a1dbf099d93dfe044971f90203a5d8d1975b4 (diff) | |
download | justbuild-55ba09ec97d2449b39d7fcc38c346969168d899b.tar.gz |
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.
Diffstat (limited to 'src/buildtool/execution_api/execution_service/ac_server.cpp')
-rw-r--r-- | src/buildtool/execution_api/execution_service/ac_server.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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; |