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

Method kill

src/launcher/executor.cpp:813–839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

811 }
812
813 void kill(const TaskID& _taskId, const Option<KillPolicy>& override = None())
814 {
815 // Cancel the taskCompletionTimer if it is set and ongoing.
816 if (taskCompletionTimer.isSome()) {
817 Clock::cancel(taskCompletionTimer.get());
818 taskCompletionTimer = None();
819 }
820
821 // Default grace period is set to 3s for backwards compatibility.
822 //
823 // TODO(alexr): Replace it with a more meaningful default, e.g.
824 // `shutdownGracePeriod` after the deprecation cycle, started in 1.0.
825 Duration gracePeriod = Seconds(3);
826
827 // Kill policy provided in the `Kill` event takes precedence
828 // over kill policy specified when the task was launched.
829 if (override.isSome() && override->has_grace_period()) {
830 gracePeriod = Nanoseconds(override->grace_period().nanoseconds());
831 } else if (killPolicy.isSome() && killPolicy->has_grace_period()) {
832 gracePeriod = Nanoseconds(killPolicy->grace_period().nanoseconds());
833 }
834
835 LOG(INFO) << "Received kill for task " << _taskId.value()
836 << " with grace period of " << gracePeriod;
837
838 kill(_taskId, gracePeriod);
839 }
840
841 void shutdown()
842 {

Callers 1

receivedMethod · 0.45

Calls 15

NoneClass · 0.85
SecondsClass · 0.85
NanosecondsClass · 0.85
frameworkHasCapabilityFunction · 0.85
createTaskStatusFunction · 0.85
errorMethod · 0.65
killFunction · 0.50
delayFunction · 0.50
killtreeFunction · 0.50
stringifyFunction · 0.50
isSomeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected