You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2013/08/13 21:49:56 UTC

[12/23] git commit: Added a log message in the master for tasks lost during slave removal.

Added a log message in the master for tasks lost during slave removal.

Review: https://reviews.apache.org/r/12044


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8b6292dc
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8b6292dc
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8b6292dc

Branch: refs/heads/vinod/0.13.0
Commit: 8b6292dcc4fcacc00c2253a90f3e6dbb3170c028
Parents: 7c306d7
Author: Benjamin Mahler <bm...@twitter.com>
Authored: Fri Jun 21 16:37:10 2013 -0700
Committer: Vinod Kone <vi...@twitter.com>
Committed: Mon Jul 1 12:18:08 2013 -0700

----------------------------------------------------------------------
 src/master/master.cpp | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8b6292dc/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 6ac86cd..df5794b 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1974,20 +1974,19 @@ void Master::removeSlave(Slave* slave)
     // Master::reregisterSlave.
     if (framework != NULL) {
       StatusUpdateMessage message;
-      StatusUpdate* update = message.mutable_update();
-      update->mutable_framework_id()->MergeFrom(task->framework_id());
-
-      if (task->has_executor_id()) {
-        update->mutable_executor_id()->MergeFrom(task->executor_id());
-      }
+      message.mutable_update()->CopyFrom(
+          protobuf::createStatusUpdate(
+              task->framework_id(),
+              task->slave_id(),
+              task->task_id(),
+              TASK_LOST,
+              "Slave " + slave->info.hostname() + " removed",
+              (task->has_executor_id() ? task->executor_id() : None())));
+
+      LOG(INFO) << "Sending status update " << message.update()
+                << " due to the removal of slave "
+                << slave->id << " (" << slave->info.hostname() << ")";
 
-      update->mutable_slave_id()->MergeFrom(task->slave_id());
-      TaskStatus* status = update->mutable_status();
-      status->mutable_task_id()->MergeFrom(task->task_id());
-      status->set_state(TASK_LOST);
-      status->set_message("Slave " + slave->info.hostname() + " removed");
-      update->set_timestamp(Clock::now().secs());
-      update->set_uuid(UUID::random().toBytes());
       send(framework->pid, message);
     }
     removeTask(task);