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

Function extendLifetime

src/linux/systemd.cpp:77–104  ·  view source on GitHub ↗

NOTE: Returning an Error implies the child process will be killed.

Source from the content-addressed store, hash-verified

75
76// NOTE: Returning an Error implies the child process will be killed.
77Try<Nothing> extendLifetime(pid_t child)
78{
79 if (!systemd::exists()) {
80 return Error("Failed to contain process on systemd: "
81 "systemd does not exist on this system");
82 }
83
84 if (!systemd::enabled()) {
85 return Error("Failed to contain process on systemd: "
86 "systemd is not configured as enabled on this system");
87 }
88
89 Try<Nothing> assign = cgroups::assign(
90 hierarchy(),
91 systemd::mesos::MESOS_EXECUTORS_SLICE,
92 child);
93
94 if (assign.isError()) {
95 return Error("Failed to contain process on systemd: "
96 "Failed to assign process to its systemd executor slice: " +
97 assign.error());
98 }
99
100 LOG(INFO) << "Assigned child process '" << child << "' to '"
101 << systemd::mesos::MESOS_EXECUTORS_SLICE << "'";
102
103 return Nothing();
104}
105
106} // namespace mesos {
107

Callers

nothing calls this directly

Calls 8

assignFunction · 0.85
NothingClass · 0.85
existsFunction · 0.70
enabledFunction · 0.70
hierarchyFunction · 0.70
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45

Tested by

no test coverage detected