| 5850 | |
| 5851 | |
| 5852 | void Slave::_reregisterExecutor( |
| 5853 | const Future<Nothing>& future, |
| 5854 | const FrameworkID& frameworkId, |
| 5855 | const ExecutorID& executorId, |
| 5856 | const ContainerID& containerId) |
| 5857 | { |
| 5858 | if (!future.isReady()) { |
| 5859 | LOG(ERROR) << "Failed to update resources for container " << containerId |
| 5860 | << " of executor '" << executorId |
| 5861 | << "' of framework " << frameworkId |
| 5862 | << ", destroying container: " |
| 5863 | << (future.isFailed() ? future.failure() : "discarded"); |
| 5864 | |
| 5865 | containerizer->destroy(containerId); |
| 5866 | |
| 5867 | Executor* executor = getExecutor(frameworkId, executorId); |
| 5868 | if (executor != nullptr) { |
| 5869 | Framework* framework = getFramework(frameworkId); |
| 5870 | CHECK_NOTNULL(framework); |
| 5871 | |
| 5872 | // Send TASK_GONE because the task was started but has now |
| 5873 | // been terminated. If the framework is not partition-aware, |
| 5874 | // we send TASK_LOST instead for backward compatibility. |
| 5875 | mesos::TaskState taskState = TASK_GONE; |
| 5876 | if (!framework->capabilities.partitionAware) { |
| 5877 | taskState = TASK_LOST; |
| 5878 | } |
| 5879 | |
| 5880 | ContainerTermination termination; |
| 5881 | termination.set_state(taskState); |
| 5882 | termination.set_reason(TaskStatus::REASON_CONTAINER_UPDATE_FAILED); |
| 5883 | termination.set_message( |
| 5884 | "Failed to update resources for container: " + |
| 5885 | (future.isFailed() ? future.failure() : "discarded")); |
| 5886 | |
| 5887 | executor->pendingTermination = termination; |
| 5888 | |
| 5889 | // TODO(jieyu): Set executor->state to be TERMINATING. |
| 5890 | } |
| 5891 | } |
| 5892 | } |
| 5893 | |
| 5894 | |
| 5895 | void Slave::reregisterExecutorTimeout() |