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

Function cleanup

src/linux/cgroups.cpp:1699–1721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1697
1698
1699Future<bool> cleanup(const string& hierarchy)
1700{
1701 Try<bool> mounted = cgroups::mounted(hierarchy);
1702 if (mounted.isError()) {
1703 return Failure(mounted.error());
1704 }
1705
1706 if (mounted.get()) {
1707 // Destroy all cgroups and then cleanup.
1708 return destroy(hierarchy)
1709 .then(lambda::bind(_cleanup, hierarchy));
1710 } else {
1711 // Remove the directory if it still exists.
1712 if (os::exists(hierarchy)) {
1713 Try<Nothing> rmdir = os::rmdir(hierarchy);
1714 if (rmdir.isError()) {
1715 return Failure(rmdir.error());
1716 }
1717 }
1718 }
1719
1720 return true;
1721}
1722
1723
1724Future<bool> _cleanup(const string& hierarchy)

Callers 5

foreachFunction · 0.50
foreachFunction · 0.50
foreachFunction · 0.50
foreachFunction · 0.50
foreachFunction · 0.50

Calls 10

mountedFunction · 0.85
FailureClass · 0.85
destroyFunction · 0.85
existsFunction · 0.70
errorMethod · 0.65
bindFunction · 0.50
rmdirFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected