Commit 34a8b1fd authored by FengyunPan2's avatar FengyunPan2

Add helpful log for checking cgrop path

Currently I just get 'xxx cgroup does not exist', but I don't know which path has missed. Let's add log for it.
parent 40098179
...@@ -257,6 +257,7 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool { ...@@ -257,6 +257,7 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool {
// once resolved, we can remove this code. // once resolved, we can remove this code.
whitelistControllers := sets.NewString("cpu", "cpuacct", "cpuset", "memory", "systemd") whitelistControllers := sets.NewString("cpu", "cpuacct", "cpuset", "memory", "systemd")
var missingPaths []string
// If even one cgroup path doesn't exist, then the cgroup doesn't exist. // If even one cgroup path doesn't exist, then the cgroup doesn't exist.
for controller, path := range cgroupPaths { for controller, path := range cgroupPaths {
// ignore mounts we don't care about // ignore mounts we don't care about
...@@ -264,10 +265,15 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool { ...@@ -264,10 +265,15 @@ func (m *cgroupManagerImpl) Exists(name CgroupName) bool {
continue continue
} }
if !libcontainercgroups.PathExists(path) { if !libcontainercgroups.PathExists(path) {
return false missingPaths = append(missingPaths, path)
} }
} }
if len(missingPaths) > 0 {
glog.V(4).Infof("The Cgroup %v has some missing paths: %v", name, missingPaths)
return false
}
return true return true
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment