| 455 | void frameworkMessage(ExecutorDriver* driver, const string& data) {} |
| 456 | |
| 457 | void shutdown(ExecutorDriver* driver) |
| 458 | { |
| 459 | LOG(INFO) << "Shutting down"; |
| 460 | |
| 461 | // Currently, 'docker->run' uses the reaper internally, hence we need |
| 462 | // to account for the reap interval. We also leave a small buffer of |
| 463 | // time to do the forced kill, otherwise the agent may destroy the |
| 464 | // container before we can send `TASK_KILLED`. |
| 465 | // |
| 466 | // TODO(alexr): Remove `MAX_REAP_INTERVAL` once the reaper signals |
| 467 | // immediately after the watched process has exited. |
| 468 | Duration gracePeriod = |
| 469 | shutdownGracePeriod - process::MAX_REAP_INTERVAL() - Seconds(1); |
| 470 | |
| 471 | // Since the docker executor manages a single task, |
| 472 | // shutdown boils down to killing this task. |
| 473 | // |
| 474 | // TODO(bmahler): If a shutdown arrives after a kill task within |
| 475 | // the grace period of the `KillPolicy`, we may need to escalate |
| 476 | // more quickly (e.g. the shutdown grace period allotted by the |
| 477 | // agent is smaller than the kill grace period). |
| 478 | if (run.isSome()) { |
| 479 | CHECK_SOME(taskId); |
| 480 | killTask(driver, taskId.get(), gracePeriod); |
| 481 | } else { |
| 482 | driver->stop(); |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | void error(ExecutorDriver* driver, const string& message) {} |
| 487 |
nothing calls this directly
no test coverage detected