Repository: mesos Updated Branches: refs/heads/master 2e4829221 -> b09f8af51
Stopped using RunTaskMessage.framework_id. FrameworkID can be retrieved from RunTaskMessage.framework. Review: https://reviews.apache.org/r/32587 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b09f8af5 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b09f8af5 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b09f8af5 Branch: refs/heads/master Commit: b09f8af511f4cff5b923e9e05785b7f6539069a9 Parents: 2e48292 Author: Kapil Arya <[email protected]> Authored: Thu Jul 30 10:06:06 2015 -0700 Committer: Adam B <[email protected]> Committed: Thu Jul 30 10:06:06 2015 -0700 ---------------------------------------------------------------------- src/master/master.cpp | 1 - src/slave/slave.cpp | 16 +++++----------- src/tests/mesos.cpp | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/b09f8af5/src/master/master.cpp ---------------------------------------------------------------------- diff --git a/src/master/master.cpp b/src/master/master.cpp index 2bfec2f..8162b2b 100644 --- a/src/master/master.cpp +++ b/src/master/master.cpp @@ -2837,7 +2837,6 @@ void Master::_accept( RunTaskMessage message; message.mutable_framework()->MergeFrom(framework->info); - message.mutable_framework_id()->MergeFrom(framework->id()); // TODO(anand): We set 'pid' to UPID() for http frameworks // as 'pid' was made optional in 0.24.0. In 0.25.0, we http://git-wip-us.apache.org/repos/asf/mesos/blob/b09f8af5/src/slave/slave.cpp ---------------------------------------------------------------------- diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp index f91fa92..6b21db9 100644 --- a/src/slave/slave.cpp +++ b/src/slave/slave.cpp @@ -1225,7 +1225,7 @@ Future<bool> Slave::unschedule(const string& path) // send TASK_LOST to the framework. void Slave::runTask( const UPID& from, - const FrameworkInfo& frameworkInfo_, + const FrameworkInfo& frameworkInfo, const FrameworkID& frameworkId_, const UPID& pid, TaskInfo task) @@ -1237,10 +1237,10 @@ void Slave::runTask( return; } - // Merge frameworkId_ into frameworkInfo. - FrameworkInfo frameworkInfo = frameworkInfo_; if (!frameworkInfo.has_id()) { - frameworkInfo.mutable_id()->CopyFrom(frameworkId_); + LOG(ERROR) << "Ignoring run task message from " << from + << " because it does not have a framework ID"; + return; } // Create frameworkId alias to use in the rest of the function. @@ -1741,7 +1741,6 @@ void Slave::runTasks( << "' of framework " << framework->id(); RunTaskMessage message; - message.mutable_framework_id()->MergeFrom(framework->id()); message.mutable_framework()->MergeFrom(framework->info); message.mutable_task()->MergeFrom(task); @@ -4170,14 +4169,9 @@ void Slave::recoverFramework(const FrameworkState& state) CHECK(!frameworks.contains(state.id)); - // Merge state.id into state.info. CHECK_SOME(state.info); FrameworkInfo frameworkInfo = state.info.get(); - if (!frameworkInfo.has_id()) { - frameworkInfo.mutable_id()->MergeFrom(state.id); - } else { - CHECK_EQ(frameworkInfo.id(), state.id); - } + CHECK(frameworkInfo.has_id()); // In 0.24.0, HTTP schedulers are supported and these do not // have a 'pid'. In this case, the slave will checkpoint UPID(). http://git-wip-us.apache.org/repos/asf/mesos/blob/b09f8af5/src/tests/mesos.cpp ---------------------------------------------------------------------- diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp index f3b7315..a2a469e 100644 --- a/src/tests/mesos.cpp +++ b/src/tests/mesos.cpp @@ -488,7 +488,7 @@ void MockSlave::unmocked_runTask( const UPID& pid, TaskInfo task) { - slave::Slave::runTask(from, frameworkInfo, frameworkId, pid, task); + slave::Slave::runTask(from, frameworkInfo, frameworkInfo.id(), pid, task); }
