Skip to content

Fix task load.#1598

Merged
estesp merged 1 commit intocontainerd:masterfrom
Random-Liu:fix-load-task
Oct 6, 2017
Merged

Fix task load.#1598
estesp merged 1 commit intocontainerd:masterfrom
Random-Liu:fix-load-task

Conversation

@Random-Liu
Copy link
Member

Rely on containerd/cgroups#30.

Currently, after runc container exits, the cgroups will be gone, and cgroups.Load will always return error.

This means that we'll never be able to reload a stopped Task:

ERRO[0000] loading task type                             error="parse cgroup file /proc/14651/cgroup: open /proc/14651/cgroup: no such file or directory" module="containerd/io.containerd.runtime.v1.linux"
ERRO[0000] loading task type                             error="parse cgroup file /proc/5311/cgroup: open /proc/5311/cgroup: no such file or directory" module="containerd/io.containerd.runtime.v1.linux"

This PR ignores cgroups.ErrCgroupDeleted and fixes other places correspondingly.

Actually, it would be ideal if Metrics could always return ErrNotFound after runc container dies, but that is not the case today even with this PR.

Signed-off-by: Lantao Liu [email protected]

@Random-Liu
Copy link
Member Author

@crosbymichael

linux/task.go Outdated
Copy link
Member Author

Choose a reason for hiding this comment

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

Can we not IgnoreNotExist error here, and return ErrNotFound error?
@crosbymichael

Copy link
Member

Choose a reason for hiding this comment

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

This is hard because it will error if one subsystem does not exit. We would have to modify the cgroup code more to see if none of the cgroups exits.

Copy link
Member Author

@Random-Liu Random-Liu Oct 5, 2017

Choose a reason for hiding this comment

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

I see. We've handled empty stats in cri-containerd containerd/cri#328, so it's fine. :)

@codecov-io
Copy link

Codecov Report

Merging #1598 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1598   +/-   ##
=======================================
  Coverage   46.29%   46.29%           
=======================================
  Files          24       24           
  Lines        3378     3378           
=======================================
  Hits         1564     1564           
  Misses       1456     1456           
  Partials      358      358

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72a3a01...989cf4c. Read the comment docs.

@crosbymichael
Copy link
Member

@Random-Liu do you want to include the cgroups package bump in this or do you want me to update that in a separate PR?

@Random-Liu
Copy link
Member Author

@crosbymichael I'll do soon.

Signed-off-by: Lantao Liu <[email protected]>
@Random-Liu
Copy link
Member Author

@crosbymichael Done.

@crosbymichael
Copy link
Member

LGTM

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 987fcd1 into containerd:master Oct 6, 2017
@Random-Liu Random-Liu deleted the fix-load-task branch October 6, 2017 20:39
AkihiroSuda added a commit to AkihiroSuda/containerd that referenced this pull request Jul 17, 2019
Fix a Rootless Docker-in-Docker issue on Fedora 30: docker-library/docker#165 (comment)
Related: containerd#1598

Signed-off-by: Akihiro Suda <[email protected]>
AkihiroSuda added a commit to AkihiroSuda/containerd that referenced this pull request Jul 18, 2019
Fix a Rootless Docker-in-Docker issue on Fedora 30: docker-library/docker#165 (comment)
Related: containerd#1598

Signed-off-by: Akihiro Suda <[email protected]>
(cherry picked from commit fab016c)
Signed-off-by: Akihiro Suda <[email protected]>
tussennet pushed a commit to tussennet/containerd that referenced this pull request Sep 11, 2020
Fix a Rootless Docker-in-Docker issue on Fedora 30: docker-library/docker#165 (comment)
Related: containerd#1598

Signed-off-by: Akihiro Suda <[email protected]>
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