summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_engine/executor
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/execution_engine/executor')
-rw-r--r--src/buildtool/execution_engine/executor/TARGETS2
-rw-r--r--src/buildtool/execution_engine/executor/executor.hpp22
2 files changed, 16 insertions, 8 deletions
diff --git a/src/buildtool/execution_engine/executor/TARGETS b/src/buildtool/execution_engine/executor/TARGETS
index 82171387..6855f87b 100644
--- a/src/buildtool/execution_engine/executor/TARGETS
+++ b/src/buildtool/execution_engine/executor/TARGETS
@@ -5,12 +5,14 @@
, "deps":
[ ["src/buildtool/logging", "log_level"]
, ["src/buildtool/logging", "logging"]
+ , ["src/buildtool/common", "common"]
, ["src/buildtool/common", "config"]
, ["src/buildtool/common", "tree"]
, ["src/buildtool/compatibility", "compatibility"]
, ["src/buildtool/file_system", "file_system_manager"]
, ["src/buildtool/execution_engine/dag", "dag"]
, ["src/buildtool/execution_api/common", "common"]
+ , ["src/buildtool/execution_api/common", "common_api"]
, ["src/buildtool/execution_api/remote", "config"]
, ["src/buildtool/execution_api/remote", "bazel"]
, ["src/buildtool/progress_reporting", "progress"]
diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp
index 2f14446a..ad933a93 100644
--- a/src/buildtool/execution_engine/executor/executor.hpp
+++ b/src/buildtool/execution_engine/executor/executor.hpp
@@ -28,11 +28,14 @@
#include <vector>
#include "gsl/gsl"
+#include "src/buildtool/common/artifact_digest.hpp"
#include "src/buildtool/common/remote/remote_common.hpp"
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/common/statistics.hpp"
#include "src/buildtool/common/tree.hpp"
#include "src/buildtool/compatibility/compatibility.hpp"
+#include "src/buildtool/execution_api/common/artifact_blob_container.hpp"
+#include "src/buildtool/execution_api/common/common_api.hpp"
#include "src/buildtool/execution_api/common/execution_api.hpp"
#include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp"
#include "src/buildtool/execution_api/remote/config.hpp"
@@ -303,20 +306,23 @@ class ExecutorImpl {
if (not content) {
return false;
}
- try {
- container.Emplace(
+ // store and/or upload blob, taking into account the maximum
+ // transfer size
+ if (not UpdateContainerAndUpload<ArtifactDigest>(
+ &container,
ArtifactBlob{digest,
std::move(*content),
- IsExecutableObject(entry->Type())});
- } catch (std::exception const& ex) {
- Logger::Log(LogLevel::Error,
- "failed to create blob with: ",
- ex.what());
+ IsExecutableObject(entry->Type())},
+ /*exception_is_fatal=*/true,
+ [&api](ArtifactBlobContainer&& blobs) {
+ return api->Upload(std::move(blobs),
+ /*skip_find_missing=*/true);
+ })) {
return false;
}
}
}
-
+ // upload remaining blobs
return api->Upload(std::move(container), /*skip_find_missing=*/true);
}