summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_engine/executor/executor.hpp16
-rw-r--r--src/buildtool/graph_traverser/graph_traverser.hpp9
2 files changed, 18 insertions, 7 deletions
diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp
index 02a56f49..546c5165 100644
--- a/src/buildtool/execution_engine/executor/executor.hpp
+++ b/src/buildtool/execution_engine/executor/executor.hpp
@@ -72,8 +72,11 @@ class ExecutorImpl {
return std::nullopt;
}
- Progress::Instance().Start(action->Content().Id());
- Statistics::Instance().IncrementActionsQueuedCounter();
+ // do not count statistics for rebuilder fetching from cache
+ if (cache_flag != IExecutionAction::CacheFlag::FromCacheOnly) {
+ Progress::Instance().Start(action->Content().Id());
+ Statistics::Instance().IncrementActionsQueuedCounter();
+ }
auto remote_action = api->CreateAction(*root_digest,
action->Command(),
@@ -414,8 +417,8 @@ class ExecutorImpl {
[[nodiscard]] static auto ParseResponse(
Logger const& logger,
IExecutionResponse::Ptr const& response,
- gsl::not_null<DependencyGraph::ActionNode const*> const& action)
- -> bool {
+ gsl::not_null<DependencyGraph::ActionNode const*> const& action,
+ bool count_as_executed = false) -> bool {
logger.Emit(LogLevel::Trace, "finished execution");
if (!response) {
@@ -423,7 +426,7 @@ class ExecutorImpl {
return false;
}
- if (response->IsCached()) {
+ if (not count_as_executed and response->IsCached()) {
logger.Emit(LogLevel::Trace, " - served from cache");
Statistics::Instance().IncrementActionsCachedCounter();
}
@@ -618,7 +621,8 @@ class Rebuilder {
}
DetectFlakyAction(*response, *response_cached, action->Content());
- return Impl::ParseResponse(logger, *response, action);
+ return Impl::ParseResponse(
+ logger, *response, action, /*count_as_executed=*/true);
}
[[nodiscard]] auto Process(
diff --git a/src/buildtool/graph_traverser/graph_traverser.hpp b/src/buildtool/graph_traverser/graph_traverser.hpp
index acd1515a..0e81d46e 100644
--- a/src/buildtool/graph_traverser/graph_traverser.hpp
+++ b/src/buildtool/graph_traverser/graph_traverser.hpp
@@ -351,12 +351,19 @@ class GraphTraverser {
RemoteExecutionConfig::PlatformProperties(),
clargs_.build.timeout};
bool traversing{false};
- std::atomic<bool> failed{false};
+ std::atomic<bool> done = false;
+ std::atomic<bool> failed = false;
+ std::condition_variable cv{};
+ auto observer =
+ std::thread([this, &done, &cv]() { reporter_(&done, &cv); });
{
Traverser t{executor, g, clargs_.jobs, &failed};
traversing =
t.Traverse({std::begin(artifact_ids), std::end(artifact_ids)});
}
+ done = true;
+ cv.notify_all();
+ observer.join();
if (traversing and not failed and clargs_.rebuild->dump_flaky) {
std::ofstream file{*clargs_.rebuild->dump_flaky};