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

Function isolate

src/linux/cgroups.cpp:949–968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

947
948
949Try<Nothing> isolate(
950 const string& hierarchy,
951 const string& cgroup,
952 pid_t pid)
953{
954 // Create cgroup if necessary.
955 if (!cgroups::exists(hierarchy, cgroup)) {
956 Try<Nothing> create = cgroups::create(hierarchy, cgroup, true);
957 if (create.isError()) {
958 return Error("Failed to create cgroup: " + create.error());
959 }
960 }
961
962 Try<Nothing> assign = cgroups::assign(hierarchy, cgroup, pid);
963 if (assign.isError()) {
964 return Error("Failed to assign process to cgroup: " + assign.error());
965 }
966
967 return Nothing();
968}
969
970
971namespace event {

Callers 3

MockIsolatorMethod · 0.85
forkMethod · 0.85
_launchMethod · 0.85

Calls 7

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

Tested by 1

MockIsolatorMethod · 0.68