Skip to content

Commit 0ecd2b6

Browse files
committed
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 <[email protected]>
1 parent 51b62d3 commit 0ecd2b6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cgroup.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ func (c *cgroup) MoveTo(destination Cgroup) error {
497497
}
498498
for _, p := range processes {
499499
if err := destination.Add(p); err != nil {
500+
if strings.Contains(err.Error(), "no such process") {
501+
continue
502+
}
500503
return err
501504
}
502505
}

0 commit comments

Comments
 (0)