MCPcopy Create free account
hub / github.com/apache/mesos / runTask

Method runTask

src/slave/slave.cpp:2160–2198  ·  view source on GitHub ↗

TODO(vinod): Instead of crashing the slave on checkpoint errors, send TASK_LOST to the framework.

Source from the content-addressed store, hash-verified

2158// TODO(vinod): Instead of crashing the slave on checkpoint errors,
2159// send TASK_LOST to the framework.
2160void Slave::runTask(
2161 const UPID& from,
2162 const FrameworkInfo& frameworkInfo,
2163 const FrameworkID& frameworkId,
2164 const UPID& pid,
2165 const TaskInfo& task,
2166 const vector<ResourceVersionUUID>& resourceVersionUuids,
2167 const Option<bool>& launchExecutor)
2168{
2169 CHECK_NE(task.has_executor(), task.has_command())
2170 << "Task " << task.task_id()
2171 << " should have either CommandInfo or ExecutorInfo set but not both";
2172
2173 if (master != from) {
2174 LOG(WARNING) << "Ignoring run task message from " << from
2175 << " because it is not the expected master: "
2176 << (master.isSome() ? stringify(master.get()) : "None");
2177 return;
2178 }
2179
2180 if (!frameworkInfo.has_id()) {
2181 LOG(ERROR) << "Ignoring run task message from " << from
2182 << " because it does not have a framework ID";
2183 return;
2184 }
2185
2186 const ExecutorInfo executorInfo = getExecutorInfo(frameworkInfo, task);
2187
2188 bool executorGeneratedForCommandTask = !task.has_executor();
2189
2190 run(frameworkInfo,
2191 executorInfo,
2192 task,
2193 None(),
2194 resourceVersionUuids,
2195 pid,
2196 launchExecutor,
2197 executorGeneratedForCommandTask);
2198}
2199
2200
2201Option<Error> Slave::validateResourceLimitsAndIsolators(

Callers

nothing calls this directly

Calls 5

NoneClass · 0.85
stringifyFunction · 0.50
runFunction · 0.50
isSomeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected