| 169 | |
| 170 | |
| 171 | void ProxyExecutor::killTask(ExecutorDriver* driver, |
| 172 | const TaskID& taskId) |
| 173 | { |
| 174 | InterpreterLock lock; |
| 175 | |
| 176 | PyObject* taskIdObj = nullptr; |
| 177 | PyObject* res = nullptr; |
| 178 | |
| 179 | taskIdObj = createPythonProtobuf(taskId, "TaskID"); |
| 180 | if (taskIdObj == nullptr) { |
| 181 | goto cleanup; // createPythonProtobuf will have set an exception. |
| 182 | } |
| 183 | |
| 184 | res = PyObject_CallMethod(impl->pythonExecutor, |
| 185 | (char*) "killTask", |
| 186 | (char*) "OO", |
| 187 | impl, |
| 188 | taskIdObj); |
| 189 | if (res == nullptr) { |
| 190 | cerr << "Failed to call executor's killTask" << endl; |
| 191 | goto cleanup; |
| 192 | } |
| 193 | |
| 194 | cleanup: |
| 195 | if (PyErr_Occurred()) { |
| 196 | PyErr_Print(); |
| 197 | driver->abort(); |
| 198 | } |
| 199 | Py_XDECREF(taskIdObj); |
| 200 | Py_XDECREF(res); |
| 201 | } |
| 202 | |
| 203 | |
| 204 | void ProxyExecutor::frameworkMessage(ExecutorDriver* driver, |
nothing calls this directly
no test coverage detected