mirror of
https://github.com/apache/impala.git
synced 2025-12-26 14:02:53 -05:00
RedHat 9 and Ubuntu 22 switch to cgroups v2, which has a different hierarchy than cgroups v1. Ubuntu 20 has a hybrid layout with both cgroup and cgroup2 mounted, but the cgroup2 functionality is limited. Updates cgroup-util to - identify available cgroups in FindCGroupMounts. Prefers v1 if available, as Ubuntu 20's hybrid layout provides only limited v2 interfaces. - refactors file reading to follow guidelines from https://gehrcke.de/2011/06/reading-files-in-c-using-ifstream-dealing-correctly-with-badbit-failbit-eofbit-and-perror/ for clearer error handling. Specifically, failbit doesn't set errno, but we were printing it anyway (which produced misleading errors). - updates FindCGroupMemLimit to read memory.max for cgroups v2. - updates DebugString to print the correct property based on cgroup version. Removes unused cgroups test library. Testing: - proc-info-test CGroupInfo.ErrorHandling test on RHEL 9 and Ubuntu 20. - verified no error messages related to reading cgroup present in logs on RHEL 9 and Ubuntu 20. Change-Id: I8dc499bd1b490970d30ed6dcd2d16d14ab41ee8c Reviewed-on: http://gerrit.cloudera.org:8080/20105 Reviewed-by: Yida Wu <wydbaggio000@gmail.com> Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>