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

Function destroy

src/linux/cgroups.cpp:1624–1653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1622
1623
1624Future<Nothing> destroy(const string& hierarchy, const string& cgroup)
1625{
1626 // Construct the vector of cgroups to destroy.
1627 Try<vector<string>> cgroups = cgroups::get(hierarchy, cgroup);
1628 if (cgroups.isError()) {
1629 return Failure(
1630 "Failed to get nested cgroups: " + cgroups.error());
1631 }
1632
1633 vector<string> candidates = cgroups.get();
1634 if (cgroup != "/") {
1635 candidates.push_back(cgroup);
1636 }
1637
1638 if (candidates.empty()) {
1639 return Nothing();
1640 }
1641
1642 // If the freezer subsystem is available, destroy the cgroups.
1643 if (cgroups::exists(hierarchy, cgroup, "freezer.state")) {
1644 internal::Destroyer* destroyer =
1645 new internal::Destroyer(hierarchy, candidates);
1646 Future<Nothing> future = destroyer->future();
1647 spawn(destroyer, true);
1648 return future;
1649 }
1650
1651 // Attempt to remove the cgroups in a bottom-up fashion.
1652 return internal::remove(hierarchy, candidates);
1653}
1654
1655
1656static void __destroy(

Callers 15

foreachFunction · 0.85
TEST_FFunction · 0.85
destroyMethod · 0.85
killMethod · 0.85
setupMethod · 0.85
TEST_FFunction · 0.85
foreachMethod · 0.85
TEST_FFunction · 0.85
TestLauncherMethod · 0.85
TEST_FFunction · 0.85
foreachFunction · 0.85

Calls 13

FailureClass · 0.85
NothingClass · 0.85
afterMethod · 0.80
getFunction · 0.70
existsFunction · 0.70
removeFunction · 0.70
errorMethod · 0.65
spawnFunction · 0.50
bindFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45

Tested by 11

foreachFunction · 0.68
TEST_FFunction · 0.68
destroyMethod · 0.68
killMethod · 0.68
setupMethod · 0.68
TEST_FFunction · 0.68
foreachMethod · 0.68
TEST_FFunction · 0.68
TestLauncherMethod · 0.68
TEST_FFunction · 0.68
foreachFunction · 0.68