You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gr...@apache.org on 2018/04/02 18:46:52 UTC
[4/6] mesos git commit: Fixed generation of operation statuses in
`Slave::applyOperation()`.
Fixed generation of operation statuses in `Slave::applyOperation()`.
This patch updates `Slave::applyOperation()` to make it include the
operation ID in operation statuses when the ID is set.
Review: https://reviews.apache.org/r/66365/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9f3f1f97
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9f3f1f97
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9f3f1f97
Branch: refs/heads/master
Commit: 9f3f1f979d520f5a77715976dcea9ba39517ec0f
Parents: 9689d78
Author: Gaston Kleiman <ga...@mesosphere.io>
Authored: Mon Apr 2 10:44:07 2018 -0700
Committer: Greg Mann <gr...@gmail.com>
Committed: Mon Apr 2 11:43:28 2018 -0700
----------------------------------------------------------------------
src/slave/slave.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/9f3f1f97/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index a4bd4cc..b178547 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -4267,6 +4267,10 @@ void Slave::applyOperation(const ApplyOperationMessage& message)
? message.framework_id()
: Option<FrameworkID>::none();
+ Option<OperationID> operationId = message.operation_info().has_id()
+ ? message.operation_info().id()
+ : Option<OperationID>::none();
+
Result<ResourceProviderID> resourceProviderId =
getResourceProviderId(message.operation_info());
@@ -4286,7 +4290,7 @@ void Slave::applyOperation(const ApplyOperationMessage& message)
Operation* operation = new Operation(
protobuf::createOperation(
message.operation_info(),
- protobuf::createOperationStatus(OPERATION_PENDING),
+ protobuf::createOperationStatus(OPERATION_PENDING, operationId),
frameworkId,
info.id(),
uuid));
@@ -4320,7 +4324,7 @@ void Slave::applyOperation(const ApplyOperationMessage& message)
UpdateOperationStatusMessage update =
protobuf::createUpdateOperationStatusMessage(
uuid,
- protobuf::createOperationStatus(OPERATION_FINISHED),
+ protobuf::createOperationStatus(OPERATION_FINISHED, operationId),
None(),
frameworkId,
info.id());