Skip to content

Commit

Permalink
Merge pull request #358 from thaJeztah/handle_domain_threaded
Browse files Browse the repository at this point in the history
cgroup2: Manager.Delete: handle both "threaded" and "domain threaded"
  • Loading branch information
fuweid authored Dec 17, 2024
2 parents d4e976d + 2236eb0 commit bce3c7e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cgroup2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,6 @@ func (c *Manager) fallbackKill() error {
}

func (c *Manager) Delete() error {
var (
tasks []uint64
threaded bool
)
// Kernel prevents cgroups with running process from being removed,
// check the tree is empty.
//
Expand All @@ -485,13 +481,13 @@ func (c *Manager) Delete() error {
if !os.IsNotExist(err) {
return err
}
} else {
threaded = cgType == Threaded
}

if threaded {
var tasks []uint64
switch cgType {
case Threaded, DomainThreaded:
tasks, err = c.Threads(true)
} else {
default:
tasks, err = c.Procs(true)
}
if err != nil {
Expand Down

0 comments on commit bce3c7e

Please sign in to comment.