MCPcopy Create free account
hub / github.com/apache/mesos / failoverFramework

Method failoverFramework

src/master/master.cpp:10236–10272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10234
10235
10236void 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

Callers

nothing calls this directly

Calls 12

deferFunction · 0.85
updateConnectionMethod · 0.80
connectedMethod · 0.65
sendMethod · 0.65
isSomeMethod · 0.45
pidMethod · 0.45
eraseMethod · 0.45
getMethod · 0.45
containsMethod · 0.45
closedMethod · 0.45
idMethod · 0.45
heartbeatMethod · 0.45

Tested by

no test coverage detected