Просмотр исходного кода

cgroups: Join groups by writing to cgroups.procs, not tasks

cgroups.procs moves all the threads of the process, and "tasks" just
the one thread. I believe there is a risk that we move the main thread,
but then we accidentally fork off one of the other threads if the go
scheduler randomly switched to another thread. So, it seems safer (and
more correct) to use cgroups.procs.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Alexander Larsson 11 лет назад
Родитель
Сommit
9294d7f2af
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      pkg/cgroups/apply_raw.go

+ 1 - 1
pkg/cgroups/apply_raw.go

@@ -68,7 +68,7 @@ func (raw *rawCgroup) join(subsystem string, pid int) (string, error) {
 	if err := os.MkdirAll(path, 0755); err != nil && !os.IsExist(err) {
 	if err := os.MkdirAll(path, 0755); err != nil && !os.IsExist(err) {
 		return "", err
 		return "", err
 	}
 	}
-	if err := writeFile(path, "tasks", strconv.Itoa(pid)); err != nil {
+	if err := writeFile(path, "cgroup.procs", strconv.Itoa(pid)); err != nil {
 		return "", err
 		return "", err
 	}
 	}
 	return path, nil
 	return path, nil