Skip to content

Commit

Permalink
Simplify how auxiliary metadata is set in ExecuteTaskAndStreamResults (
Browse files Browse the repository at this point in the history
…#7937)

Set it in only one place instead of two.
  • Loading branch information
vanja-p authored Nov 27, 2024
1 parent 9801517 commit 49be3ac
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions enterprise/server/remote_execution/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ func (s *Executor) ExecuteTaskAndStreamResults(ctx context.Context, st *repb.Sch
}
resp := operation.ErrorResponse(finalErr)
md.WorkerCompletedTimestamp = timestamppb.Now()
if err := appendAuxiliaryMetadata(md, auxMetadata); err != nil {
log.CtxErrorf(ctx, "Failed to append auxiliary metadata: %s", err)
}
resp.Result = &repb.ActionResult{
ExecutionMetadata: md,
}
Expand All @@ -233,6 +230,9 @@ func (s *Executor) ExecuteTaskAndStreamResults(ctx context.Context, st *repb.Sch
}
return false, finalErr
}
if err := appendAuxiliaryMetadata(md, auxMetadata); err != nil {
return finishWithErrFn(status.InternalErrorf("append auxiliary metadata: %s", err))
}

stage := &stagedGauge{estimatedSize: md.EstimatedTaskSize}
defer stage.End()
Expand Down Expand Up @@ -397,9 +397,6 @@ func (s *Executor) ExecuteTaskAndStreamResults(ctx context.Context, st *repb.Sch
}
md.OutputUploadCompletedTimestamp = timestamppb.Now()
md.WorkerCompletedTimestamp = timestamppb.Now()
if err := appendAuxiliaryMetadata(md, auxMetadata); err != nil {
return finishWithErrFn(status.InternalErrorf("append auxiliary metadata: %s", err))
}
actionResult.ExecutionMetadata = md

// If the action failed or do_not_cache is set, upload information about the error via a failed
Expand Down

0 comments on commit 49be3ac

Please sign in to comment.