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

Method shutdownExecutorTimeout

src/slave/slave.cpp:7507–7555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7505
7506
7507void Slave::shutdownExecutorTimeout(
7508 const FrameworkID& frameworkId,
7509 const ExecutorID& executorId,
7510 const ContainerID& containerId)
7511{
7512 Framework* framework = getFramework(frameworkId);
7513 if (framework == nullptr) {
7514 LOG(INFO) << "Framework " << frameworkId
7515 << " seems to have exited. Ignoring shutdown timeout"
7516 << " for executor '" << executorId << "'";
7517 return;
7518 }
7519
7520 CHECK(framework->state == Framework::RUNNING ||
7521 framework->state == Framework::TERMINATING)
7522 << framework->state;
7523
7524 Executor* executor = framework->getExecutor(executorId);
7525 if (executor == nullptr) {
7526 VLOG(1) << "Executor '" << executorId
7527 << "' of framework " << frameworkId
7528 << " seems to have exited. Ignoring its shutdown timeout";
7529 return;
7530 }
7531
7532 // Make sure this timeout is valid.
7533 if (executor->containerId != containerId) {
7534 LOG(INFO) << "A new executor " << *executor
7535 << " with run " << executor->containerId
7536 << " seems to be active. Ignoring the shutdown timeout"
7537 << " for the old executor run " << containerId;
7538 return;
7539 }
7540
7541 switch (executor->state) {
7542 case Executor::TERMINATED:
7543 LOG(INFO) << "Executor " << *executor << " has already terminated";
7544 break;
7545 case Executor::TERMINATING:
7546 LOG(INFO) << "Killing executor " << *executor;
7547
7548 containerizer->destroy(executor->containerId);
7549 break;
7550 default:
7551 LOG(FATAL) << "Executor " << *executor << " is in unexpected state "
7552 << executor->state;
7553 break;
7554 }
7555}
7556
7557
7558void Slave::registerExecutorTimeout(

Callers

nothing calls this directly

Calls 2

getExecutorMethod · 0.80
destroyMethod · 0.45

Tested by

no test coverage detected