diff --git a/.changelog/16467.txt b/.changelog/16467.txt new file mode 100644 index 000000000..317bbe11c --- /dev/null +++ b/.changelog/16467.txt @@ -0,0 +1,3 @@ +```release-note:bug +client: Fixed a bug where cpuset initialization fails after Client restart +``` diff --git a/client/lib/cgutil/cpuset_manager_v1.go b/client/lib/cgutil/cpuset_manager_v1.go index f0ba00adb..1f02d15d3 100644 --- a/client/lib/cgutil/cpuset_manager_v1.go +++ b/client/lib/cgutil/cpuset_manager_v1.go @@ -4,6 +4,7 @@ package cgutil import ( "context" + "errors" "fmt" "os" "path/filepath" @@ -59,8 +60,10 @@ func NewCpusetManagerV1(cgroupParent string, _ []uint16, logger hclog.Logger) Cp // ensure the reserved cpuset exists, but only copy the mems from the parent if creating the cgroup if err = os.Mkdir(filepath.Join(cgroupParentPath, ReservedCpusetCgroupName), 0755); err != nil { - logger.Warn("failed to ensure reserved cpuset.cpus interface exists; disable cpuset management", "error", err) - return new(NoopCpusetManager) + if !errors.Is(err, os.ErrExist) { + logger.Warn("failed to ensure reserved cpuset.cpus interface exists; disable cpuset management", "error", err) + return new(NoopCpusetManager) + } } if err = cgroups.WriteFile(filepath.Join(cgroupParentPath, ReservedCpusetCgroupName), "cpuset.mems", parentMems); err != nil {