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 2015/07/25 02:35:23 UTC
mesos git commit: Updated slave to always set task status's uuid in
status update.
Repository: mesos
Updated Branches:
refs/heads/master 9a5abd79b -> d8969c0d1
Updated slave to always set task status's uuid in status update.
Review: https://reviews.apache.org/r/36805
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d8969c0d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d8969c0d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d8969c0d
Branch: refs/heads/master
Commit: d8969c0d107e3c4de15f49cc84ef82c7542f5635
Parents: 9a5abd7
Author: Vinod Kone <vi...@gmail.com>
Authored: Fri Jul 24 17:03:28 2015 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Fri Jul 24 17:35:01 2015 -0700
----------------------------------------------------------------------
src/common/protobuf_utils.cpp | 6 ++----
src/sched/sched.cpp | 6 ++----
src/slave/slave.cpp | 11 +++++++----
3 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d8969c0d/src/common/protobuf_utils.cpp
----------------------------------------------------------------------
diff --git a/src/common/protobuf_utils.cpp b/src/common/protobuf_utils.cpp
index 90a2461..0b8b04c 100644
--- a/src/common/protobuf_utils.cpp
+++ b/src/common/protobuf_utils.cpp
@@ -324,10 +324,8 @@ Event event(const StatusUpdateMessage& message)
// update uuid check here, until then we must still check for
// this being sent from the driver (from == UPID()) or from
// the master (pid == UPID()).
- //
- // TODO(bmahler): For the HTTP API, we will have to update the
- // master and slave to ensure the 'uuid' in TaskStatus is set
- // correctly.
+ // TODO(vinod): Get rid of this logic in 0.25.0 because master
+ // and slave correctly set task status in 0.24.0.
if (!message.update().has_uuid() || message.update().uuid() == "") {
update->mutable_status()->clear_uuid();
} else if (UPID(message.pid()) == UPID()) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/d8969c0d/src/sched/sched.cpp
----------------------------------------------------------------------
diff --git a/src/sched/sched.cpp b/src/sched/sched.cpp
index db0653d..012af05 100644
--- a/src/sched/sched.cpp
+++ b/src/sched/sched.cpp
@@ -890,10 +890,8 @@ protected:
// update uuid check here, until then we must still check for
// this being sent from the driver (from == UPID()) or from
// the master (pid == UPID()).
- //
- // TODO(bmahler): For the HTTP API, we will have to update the
- // master and slave to ensure the 'uuid' in TaskStatus is set
- // correctly.
+ // TODO(vinod): Get rid of this logic in 0.25.0 because master
+ // and slave correctly set task status in 0.24.0.
if (!update.has_uuid() || update.uuid() == "") {
status.clear_uuid();
} else if (from == UPID() || pid == UPID()) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/d8969c0d/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 4ba95f9..16c403b 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -2700,16 +2700,19 @@ void Slave::statusUpdate(StatusUpdate update, const UPID& pid)
state == RUNNING || state == TERMINATING)
<< state;
- // TODO(bmahler): With the HTTP API, we must validate the UUID
- // inside the TaskStatus. For now, we only care about the UUID
- // inside the StatusUpdate, as the scheduler driver overwrites it.
if (!update.has_uuid()) {
LOG(WARNING) << "Ignoring status update " << update << " without 'uuid'";
metrics.invalid_status_updates++;
return;
}
- // Set the source before forwarding the status update.
+ // TODO(bmahler): With the HTTP API, we must validate the UUID
+ // inside the TaskStatus. For now, we ensure that the uuid of task
+ // status matches the update's uuid, in case the executor is using
+ // pre 0.23.x driver.
+ update.mutable_status()->set_uuid(update.uuid());
+
+ // Set the source and UUID before forwarding the status update.
update.mutable_status()->set_source(
pid == UPID() ? TaskStatus::SOURCE_SLAVE : TaskStatus::SOURCE_EXECUTOR);