| 181 | } |
| 182 | |
| 183 | void launchTask(ExecutorDriver* driver, const TaskInfo& task) override |
| 184 | { |
| 185 | if (launched) { |
| 186 | TaskStatus status; |
| 187 | status.mutable_task_id()->MergeFrom(task.task_id()); |
| 188 | status.set_state(TASK_FAILED); |
| 189 | status.set_message( |
| 190 | "Attempted to run multiple balloon tasks with the same executor"); |
| 191 | |
| 192 | driver->sendStatusUpdate(status); |
| 193 | return; |
| 194 | } |
| 195 | |
| 196 | LOG(INFO) << "Starting task " << task.task_id().value(); |
| 197 | |
| 198 | // NOTE: The executor driver calls `launchTask` synchronously, which |
| 199 | // means that calls such as `driver->sendStatusUpdate()` will not execute |
| 200 | // until `launchTask` returns. |
| 201 | std::thread thread([=]() { |
| 202 | run(driver, task); |
| 203 | }); |
| 204 | |
| 205 | thread.detach(); |
| 206 | |
| 207 | launched = true; |
| 208 | } |
| 209 | |
| 210 | void killTask(ExecutorDriver* driver, const TaskID& taskId) override |
| 211 | { |
nothing calls this directly
no test coverage detected