| 10234 | |
| 10235 | |
| 10236 | void Master::failoverFramework( |
| 10237 | Framework* framework, |
| 10238 | const StreamingHttpConnection<v1::scheduler::Event>& http, |
| 10239 | const Owned<ObjectApprovers>& objectApprovers) |
| 10240 | { |
| 10241 | CHECK_NOTNULL(framework); |
| 10242 | |
| 10243 | // Notify the old connected framework that it has failed over. |
| 10244 | // This is safe to do even if it is a retry because the framework is expected |
| 10245 | // to close the old connection (and hence not receive any more responses) |
| 10246 | // before sending subscription request on a new connection. |
| 10247 | if (framework->connected()) { |
| 10248 | FrameworkErrorMessage message; |
| 10249 | message.set_message("Framework failed over"); |
| 10250 | framework->send(message); |
| 10251 | } |
| 10252 | |
| 10253 | // If this is an upgrade, clear the authentication related data. |
| 10254 | if (framework->pid().isSome()) { |
| 10255 | authenticated.erase(framework->pid().get()); |
| 10256 | |
| 10257 | CHECK(frameworks.principals.contains(framework->pid().get())); |
| 10258 | Option<string> principal = frameworks.principals[framework->pid().get()]; |
| 10259 | |
| 10260 | frameworks.principals.erase(framework->pid().get()); |
| 10261 | } |
| 10262 | |
| 10263 | framework->updateConnection(http, objectApprovers); |
| 10264 | |
| 10265 | http.closed() |
| 10266 | .onAny(defer(self(), &Self::exited, framework->id(), http)); |
| 10267 | |
| 10268 | _failoverFramework(framework); |
| 10269 | |
| 10270 | // Start the heartbeat after sending SUBSCRIBED event. |
| 10271 | framework->heartbeat(); |
| 10272 | } |
| 10273 | |
| 10274 | |
| 10275 | // Replace the scheduler for a framework with a new process ID, in the |
nothing calls this directly
no test coverage detected