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

Method launchTask

src/python/executor/src/mesos/executor/proxy_executor.cpp:138–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136
137
138void ProxyExecutor::launchTask(ExecutorDriver* driver,
139 const TaskInfo& task)
140{
141 InterpreterLock lock;
142
143 PyObject* taskObj = nullptr;
144 PyObject* res = nullptr;
145
146 taskObj = createPythonProtobuf(task, "TaskInfo");
147 if (taskObj == nullptr) {
148 goto cleanup; // createPythonProtobuf will have set an exception.
149 }
150
151 res = PyObject_CallMethod(impl->pythonExecutor,
152 (char*) "launchTask",
153 (char*) "OO",
154 impl,
155 taskObj);
156 if (res == nullptr) {
157 cerr << "Failed to call executor's launchTask" << endl;
158 goto cleanup;
159 }
160
161cleanup:
162 if (PyErr_Occurred()) {
163 PyErr_Print();
164 driver->abort();
165 }
166 Py_XDECREF(taskObj);
167 Py_XDECREF(res);
168}
169
170
171void ProxyExecutor::killTask(ExecutorDriver* driver,

Callers

nothing calls this directly

Calls 2

createPythonProtobufFunction · 0.85
abortMethod · 0.65

Tested by

no test coverage detected