| 115 | void disconnected() {} |
| 116 | |
| 117 | void killTask(const mesos::TaskID& taskId) |
| 118 | { |
| 119 | // Logically an executor cannot receive any response from an agent if it |
| 120 | // is not connected. Since we have received `killTask`, we assume we are |
| 121 | // connected and trigger the `connected` callback to enable event delivery. |
| 122 | // This satisfies the invariant of the v1 interface that an executor can |
| 123 | // receive an event only after successfully connecting with the agent. |
| 124 | if (!connected) { |
| 125 | LOG(INFO) << "Implicitly connecting the executor to kill a task"; |
| 126 | callbacks.connected(); |
| 127 | connected = true; |
| 128 | } |
| 129 | |
| 130 | Event event; |
| 131 | event.set_type(Event::KILL); |
| 132 | |
| 133 | Event::Kill* kill = event.mutable_kill(); |
| 134 | |
| 135 | kill->mutable_task_id()->CopyFrom(evolve(taskId)); |
| 136 | |
| 137 | received(event); |
| 138 | } |
| 139 | |
| 140 | void launchTask(const mesos::TaskInfo& task) |
| 141 | { |