| 7072 | |
| 7073 | |
| 7074 | void Slave::executorTerminated( |
| 7075 | const FrameworkID& frameworkId, |
| 7076 | const ExecutorID& executorId, |
| 7077 | const Future<Option<ContainerTermination>>& termination) |
| 7078 | { |
| 7079 | int status; |
| 7080 | // A termination failure indicates the containerizer could not destroy a |
| 7081 | // container. |
| 7082 | // TODO(idownes): This is a serious error so consider aborting the slave if |
| 7083 | // this occurs. |
| 7084 | if (!termination.isReady()) { |
| 7085 | LOG(ERROR) << "Termination of executor '" << executorId |
| 7086 | << "' of framework " << frameworkId |
| 7087 | << " failed: " |
| 7088 | << (termination.isFailed() |
| 7089 | ? termination.failure() |
| 7090 | : "discarded"); |
| 7091 | // Set a special status for failure. |
| 7092 | status = -1; |
| 7093 | } else if (termination->isNone()) { |
| 7094 | LOG(ERROR) << "Termination of executor '" << executorId |
| 7095 | << "' of framework " << frameworkId |
| 7096 | << " failed: unknown container"; |
| 7097 | // Set a special status for failure. |
| 7098 | status = -1; |
| 7099 | } else if (!termination->get().has_status()) { |
| 7100 | LOG(INFO) << "Executor '" << executorId |
| 7101 | << "' of framework " << frameworkId |
| 7102 | << " has terminated with unknown status"; |
| 7103 | // Set a special status for None. |
| 7104 | status = -1; |
| 7105 | } else { |
| 7106 | status = termination->get().status(); |
| 7107 | LOG(INFO) << "Executor '" << executorId |
| 7108 | << "' of framework " << frameworkId << " " |
| 7109 | << WSTRINGIFY(status); |
| 7110 | } |
| 7111 | |
| 7112 | Framework* framework = getFramework(frameworkId); |
| 7113 | if (framework == nullptr) { |
| 7114 | LOG(WARNING) << "Framework " << frameworkId |
| 7115 | << " for executor '" << executorId |
| 7116 | << "' does not exist"; |
| 7117 | return; |
| 7118 | } |
| 7119 | |
| 7120 | CHECK(framework->state == Framework::RUNNING || |
| 7121 | framework->state == Framework::TERMINATING) |
| 7122 | << framework->state; |
| 7123 | |
| 7124 | Executor* executor = framework->getExecutor(executorId); |
| 7125 | if (executor == nullptr) { |
| 7126 | LOG(WARNING) << "Executor '" << executorId |
| 7127 | << "' of framework " << frameworkId |
| 7128 | << " does not exist"; |
| 7129 | return; |
| 7130 | } |
| 7131 |
nothing calls this directly
no test coverage detected