From 0ecd2b66d378b21c371721046c14d9f23bc07877 Mon Sep 17 00:00:00 2001 From: jiangpengfei Date: Thu, 13 Jun 2019 09:19:10 -0400 Subject: [PATCH] cgroups: fix MoveTo function fail problem reason: there maybe some multi processes in the cgroup.procs file,if some processes exit before call destination.Add(p), it will get the error "no such process" which means process has exit and we just ignore this error and continue to move left processes in cgroup.procs file. Signed-off-by: jiangpengfei --- cgroup.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cgroup.go b/cgroup.go index e3ef0765..53866685 100644 --- a/cgroup.go +++ b/cgroup.go @@ -497,6 +497,9 @@ func (c *cgroup) MoveTo(destination Cgroup) error { } for _, p := range processes { if err := destination.Add(p); err != nil { + if strings.Contains(err.Error(), "no such process") { + continue + } return err } }