| 136 | |
| 137 | |
| 138 | void 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 | |
| 161 | cleanup: |
| 162 | if (PyErr_Occurred()) { |
| 163 | PyErr_Print(); |
| 164 | driver->abort(); |
| 165 | } |
| 166 | Py_XDECREF(taskObj); |
| 167 | Py_XDECREF(res); |
| 168 | } |
| 169 | |
| 170 | |
| 171 | void ProxyExecutor::killTask(ExecutorDriver* driver, |
nothing calls this directly
no test coverage detected