aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Kirchoff <[email protected]>2021-12-02 15:09:23 -0800
committerJoe Kirchoff <[email protected]>2021-12-02 15:09:23 -0800
commit0aa1e217af86593755c99e9115472a2ca048a345 (patch)
treec010d277f7dde7aca05456c4bd55be16d87e136f
parentMerge pull request #32 from EpicGames/non-elevated-asio (diff)
downloadzen-0aa1e217af86593755c99e9115472a2ca048a345.tar.xz
zen-0aa1e217af86593755c99e9115472a2ca048a345.zip
Better error tracking when remote execute fails to post
-rw-r--r--zenserver/upstream/upstreamapply.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/zenserver/upstream/upstreamapply.cpp b/zenserver/upstream/upstreamapply.cpp
index de646a5bb..e6e54428c 100644
--- a/zenserver/upstream/upstreamapply.cpp
+++ b/zenserver/upstream/upstreamapply.cpp
@@ -112,7 +112,8 @@ namespace detail {
ElapsedSeconds += Result.ElapsedSeconds;
if (!Result.Success)
{
- return {.Error{.ErrorCode = Result.ErrorCode, .Reason = std::move(Result.Reason)},
+ return {.Error{.ErrorCode = Result.ErrorCode ? Result.ErrorCode : -1,
+ .Reason = !Result.Reason.empty() ? std::move(Result.Reason) : "Failed to upload blobs"},
.Bytes = Bytes,
.ElapsedSeconds = ElapsedSeconds};
}
@@ -125,7 +126,8 @@ namespace detail {
ElapsedSeconds += Result.ElapsedSeconds;
if (!Result.Success)
{
- return {.Error{.ErrorCode = Result.ErrorCode, .Reason = std::move(Result.Reason)},
+ return {.Error{.ErrorCode = Result.ErrorCode ? Result.ErrorCode : -1,
+ .Reason = !Result.Reason.empty() ? std::move(Result.Reason) : "Failed to upload objects"},
.Bytes = Bytes,
.ElapsedSeconds = ElapsedSeconds};
}
@@ -149,7 +151,8 @@ namespace detail {
m_PendingTasks.erase(UpstreamData.TaskId);
}
- return {.Error{.ErrorCode = Result.ErrorCode, .Reason = std::move(Result.Reason)},
+ return {.Error{.ErrorCode = Result.ErrorCode ? Result.ErrorCode : -1,
+ .Reason = !Result.Reason.empty() ? std::move(Result.Reason) : "Failed to post compute task"},
.Bytes = Bytes,
.ElapsedSeconds = ElapsedSeconds};
}
@@ -460,13 +463,6 @@ namespace detail {
Bytes += ObjectTreeResult.Bytes;
ElapsedSeconds += ObjectTreeResult.ElapsedSeconds;
- if (ObjectTreeResult.ErrorCode != 0)
- {
- return {.Error{.ErrorCode = ObjectTreeResult.ErrorCode, .Reason = std::move(ObjectTreeResult.Reason)},
- .Bytes = Bytes,
- .ElapsedSeconds = ElapsedSeconds};
- }
-
if (!ObjectTreeResult.Success)
{
return {.Error{.ErrorCode = -1, .Reason = "Failed to get result object data"},
@@ -592,7 +588,9 @@ namespace detail {
{
return {.Error{.ErrorCode = ExitCode, .Reason = "Build.output file not found in task results"},
.Bytes = Bytes,
- .ElapsedSeconds = ElapsedSeconds};
+ .ElapsedSeconds = ElapsedSeconds,
+ .StdOut = std::move(StdOut),
+ .StdErr = std::move(StdErr)};
}
// Get Output directory node
@@ -611,7 +609,9 @@ namespace detail {
{
return {.Error{.ErrorCode = ExitCode, .Reason = "Outputs directory not found in task results"},
.Bytes = Bytes,
- .ElapsedSeconds = ElapsedSeconds};
+ .ElapsedSeconds = ElapsedSeconds,
+ .StdOut = std::move(StdOut),
+ .StdErr = std::move(StdErr)};
}
// load build.output as CbObject
@@ -686,7 +686,9 @@ namespace detail {
{
return {.Error{.ErrorCode = -1, .Reason = "Failed to get result object attachment data"},
.Bytes = Bytes,
- .ElapsedSeconds = ElapsedSeconds};
+ .ElapsedSeconds = ElapsedSeconds,
+ .StdOut = std::move(StdOut),
+ .StdErr = std::move(StdErr)};
}
OutputPackage.SetObject(BuildOutputObject);
@@ -746,8 +748,8 @@ namespace detail {
std::string_view Directory = It.AsString();
std::string DummyFile = "{}/.zen_empty_file"_format(Directory);
InputFiles.insert(DummyFile);
- Data.Blobs[EmptyBufferId] = EmptyBuffer;
- InputFileHashes[DummyFile] = EmptyBufferId;
+ Data.Blobs[EmptyBufferId] = EmptyBuffer;
+ InputFileHashes[DummyFile] = EmptyBufferId;
}
for (auto& It : ApplyRecord.WorkerDescriptor["environment"sv])