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

Method registerExecutorTimeout

src/slave/slave.cpp:7558–7629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7556
7557
7558void Slave::registerExecutorTimeout(
7559 const FrameworkID& frameworkId,
7560 const ExecutorID& executorId,
7561 const ContainerID& containerId)
7562{
7563 Framework* framework = getFramework(frameworkId);
7564 if (framework == nullptr) {
7565 LOG(INFO) << "Framework " << frameworkId
7566 << " seems to have exited. Ignoring registration timeout"
7567 << " for executor '" << executorId << "'";
7568 return;
7569 }
7570
7571 CHECK(framework->state == Framework::RUNNING ||
7572 framework->state == Framework::TERMINATING)
7573 << framework->state;
7574
7575 if (framework->state == Framework::TERMINATING) {
7576 LOG(INFO) << "Ignoring registration timeout for executor '" << executorId
7577 << "' because the framework " << frameworkId
7578 << " is terminating";
7579 return;
7580 }
7581
7582 Executor* executor = framework->getExecutor(executorId);
7583 if (executor == nullptr) {
7584 VLOG(1) << "Executor '" << executorId
7585 << "' of framework " << frameworkId
7586 << " seems to have exited. Ignoring its registration timeout";
7587 return;
7588 }
7589
7590 if (executor->containerId != containerId) {
7591 LOG(INFO) << "A new executor " << *executor
7592 << " with run " << executor->containerId
7593 << " seems to be active. Ignoring the registration timeout"
7594 << " for the old executor run " << containerId;
7595 return;
7596 }
7597
7598 switch (executor->state) {
7599 case Executor::RUNNING:
7600 case Executor::TERMINATING:
7601 case Executor::TERMINATED:
7602 // Ignore the registration timeout.
7603 break;
7604 case Executor::REGISTERING: {
7605 LOG(INFO) << "Terminating executor " << *executor
7606 << " because it did not register within "
7607 << flags.executor_registration_timeout;
7608
7609 // Immediately kill the executor.
7610 containerizer->destroy(containerId);
7611
7612 executor->state = Executor::TERMINATING;
7613
7614 ContainerTermination termination;
7615 termination.set_state(TASK_FAILED);

Callers

nothing calls this directly

Calls 3

getExecutorMethod · 0.80
stringifyFunction · 0.50
destroyMethod · 0.45

Tested by

no test coverage detected