remove will remove a cgroup path handling EAGAIN and EBUSY errors and retrying the remove after a exp timeout
(path string)
| 54 | // remove will remove a cgroup path handling EAGAIN and EBUSY errors and |
| 55 | // retrying the remove after a exp timeout |
| 56 | func remove(path string) error { |
| 57 | var err error |
| 58 | delay := 10 * time.Millisecond |
| 59 | for i := 0; i < 5; i++ { |
| 60 | if i != 0 { |
| 61 | time.Sleep(delay) |
| 62 | delay *= 2 |
| 63 | } |
| 64 | if err = os.RemoveAll(path); err == nil { |
| 65 | return nil |
| 66 | } |
| 67 | } |
| 68 | return fmt.Errorf("cgroups: unable to remove path %q: %w", path, err) |
| 69 | } |
| 70 | |
| 71 | // parseCgroupTasksFile parses /sys/fs/cgroup/$GROUPPATH/cgroup.procs or |
| 72 | // /sys/fs/cgroup/$GROUPPATH/cgroup.threads |
no outgoing calls
no test coverage detected
searching dependent graphs…