remove will remove a cgroup path handling EAGAIN and EBUSY errors and retrying the remove after a exp timeout
(path string)
| 68 | // remove will remove a cgroup path handling EAGAIN and EBUSY errors and |
| 69 | // retrying the remove after a exp timeout |
| 70 | func remove(path string) error { |
| 71 | delay := 10 * time.Millisecond |
| 72 | for i := 0; i < 5; i++ { |
| 73 | if i != 0 { |
| 74 | time.Sleep(delay) |
| 75 | delay *= 2 |
| 76 | } |
| 77 | if err := os.RemoveAll(path); err == nil { |
| 78 | return nil |
| 79 | } |
| 80 | } |
| 81 | return fmt.Errorf("cgroups: unable to remove path %q", path) |
| 82 | } |
| 83 | |
| 84 | // readPids will read all the pids of processes or tasks in a cgroup by the provided path |
| 85 | func readPids(path string, subsystem Name, pType procType) ([]Process, error) { |
no outgoing calls
no test coverage detected
searching dependent graphs…