-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v0.16.0] backport: dead cgroups fix #3326
[v0.16.0] backport: dead cgroups fix #3326
Conversation
Certain kubernetes version make use of short lived cgroups for various tasks (for example log rotation). These cgroups will generate events and a very quick cgroup_rmdir event. As such, many related events to the cgroup will attempt to query its directory through the recursive path and not find it. Commit adds a "Dead" field to the cgroup info to indicate a cgroup which has already been removed. Various logical sections can refer to it if its relevant to them, and more importantly, additional queries will not be attempted. Bonus: optimize away additional Stat syscall in containers by returning the directory ctime in cgroup.GetCgroupPath. commit: 0c5719a (main), cherry-pick
I'll merge it tmr, and release 0.16.2 |
@@ -389,10 +390,12 @@ func GetCgroupControllerHierarchy(subsys string) (int, error) { | |||
// given cgroupId and subPath (related to cgroup fs root dir). If subPath is | |||
// empty, then all directories from cgroup fs will be searched for the given | |||
// cgroupId. | |||
func GetCgroupPath(rootDir string, cgroupId uint64, subPath string) (string, error) { | |||
// | |||
// Returns found cgroup path, its ctime, and an error if relevant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: godoc formatting requires function name as the first string (I know this is a backport and has been merged already).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (including the original patch).
Backport #3325