| 242 | |
| 243 | |
| 244 | void ProxyScheduler::frameworkMessage(SchedulerDriver* driver, |
| 245 | const ExecutorID& executorId, |
| 246 | const SlaveID& slaveId, |
| 247 | const string& data) |
| 248 | { |
| 249 | InterpreterLock lock; |
| 250 | |
| 251 | PyObject* eid = nullptr; |
| 252 | PyObject* sid = nullptr; |
| 253 | PyObject* res = nullptr; |
| 254 | |
| 255 | eid = createPythonProtobuf(executorId, "ExecutorID"); |
| 256 | if (eid == nullptr) { |
| 257 | goto cleanup; // createPythonProtobuf will have set an exception. |
| 258 | } |
| 259 | |
| 260 | sid = createPythonProtobuf(slaveId, "SlaveID"); |
| 261 | if (sid == nullptr) { |
| 262 | goto cleanup; // createPythonProtobuf will have set an exception. |
| 263 | } |
| 264 | |
| 265 | res = PyObject_CallMethod(impl->pythonScheduler, |
| 266 | (char*) "frameworkMessage", |
| 267 | (char*) "OOOs#", |
| 268 | impl, |
| 269 | eid, |
| 270 | sid, |
| 271 | data.data(), |
| 272 | data.length()); |
| 273 | if (res == nullptr) { |
| 274 | cerr << "Failed to call scheduler's frameworkMessage" << endl; |
| 275 | goto cleanup; |
| 276 | } |
| 277 | |
| 278 | cleanup: |
| 279 | if (PyErr_Occurred()) { |
| 280 | PyErr_Print(); |
| 281 | driver->abort(); |
| 282 | } |
| 283 | Py_XDECREF(eid); |
| 284 | Py_XDECREF(sid); |
| 285 | Py_XDECREF(res); |
| 286 | } |
| 287 | |
| 288 | |
| 289 | void ProxyScheduler::slaveLost(SchedulerDriver* driver, const SlaveID& slaveId) |
nothing calls this directly
no test coverage detected