Skip to content

cg2: Don't read cgroup.procs when deleting threaded cg - #318

Merged
fuweid merged 1 commit into
containerd:mainfrom
dcantah:cg-type-delete
Jan 24, 2024
Merged

fuweid merged 1 commit into
containerd:mainfrom
dcantah:cg-type-delete

Conversation

@dcantah

@dcantah dcantah commented Dec 31, 2023

Copy link
Copy Markdown
Member

Reading cgroup.procs seems to return ENOTSUPP when threaded, so check the type of the cg when going to delete and read the relevant file.

Reading cgroup.procs seems to return ENOTSUPP when threaded, so check
the type of the cg when going to delete and read the relevant file.

Signed-off-by: Danny Canter <danny@dcantah.dev>
Comment thread cgroup2/manager.go
if len(processes) > 0 {
return fmt.Errorf("cgroups: unable to remove path %q: still contains running processes", c.path)
if len(tasks) > 0 {
return fmt.Errorf("cgroups: unable to remove path %q: still contains running tasks", c.path)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why we don't try to remove and check for EBSUY instead?

@dcantah dcantah Jan 16, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, and this is for what was here today, it's mainly for a nice error so I tried to keep in line with what was here already. I suppose we could just immediately remove(c.path) (which tries to handle a reasonable amount of ebusy looping) although afterwards we'd still need to know what file to read to surface some decent error if the remove didn't go through.

@dcantah

dcantah commented Jan 24, 2024

Copy link
Copy Markdown
Member Author

@dmcgowan This should be ready to check in, didn't realize I got two πŸ˜†

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants