Skip to content

Transfer error to ErrNotFound when kill a not exist container#4214

Merged
estesp merged 1 commit intocontainerd:masterfrom
payall4u:bugfix-check-not-exist
May 11, 2020
Merged

Transfer error to ErrNotFound when kill a not exist container#4214
estesp merged 1 commit intocontainerd:masterfrom
payall4u:bugfix-check-not-exist

Conversation

@payall4u
Copy link
Copy Markdown
Contributor

From #4020 #4019
We encountered the same problem after upgrading containerd from v1.2.7 to v1.3.3 .Same as pr #4121.

When use cri-containerd and k8s, pod may be stuck in terminating. It happens when container is delete by runc, however containerd unawares of this or deletes container failed.When cri retry to delete container it will got a runc error container does not exist. This is because cri ignore IsNotFound error, but shim is not converting the runc error to a containerd NotFound error.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 27, 2020

Build succeeded.

Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

Please use git commit -s --amend to sign off.

@payall4u payall4u force-pushed the bugfix-check-not-exist branch from 9a311ca to f37377e Compare April 27, 2020 09:56
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 27, 2020

Build succeeded.

Comment thread pkg/process/utils.go Outdated
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 30, 2020

Build succeeded.

@payall4u
Copy link
Copy Markdown
Contributor Author

runc completely correct, but crun error:

##[error] container_test.go:696: expected error "not found" but received "unknown error after kill: runc did not terminate successfully: error opening file '/tmp/runc-test/testing/TestKillContainerDeletedByRunc/status': No such file or directory\n: unknown"

I think it may need to add an adapter for handling runtime error.

@cpuguy83
Copy link
Copy Markdown
Member

It would be nice if the shim translated this error.

Comment thread container_test.go Outdated
Comment thread container_test.go Outdated
@payall4u payall4u force-pushed the bugfix-check-not-exist branch 2 times, most recently from 20edf5f to cc54d8a Compare May 11, 2020 06:41
@codecov-io
Copy link
Copy Markdown

codecov-io commented May 11, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4214   +/-   ##
=======================================
  Coverage   38.34%   38.34%           
=======================================
  Files          90       90           
  Lines       12728    12728           
=======================================
  Hits         4881     4881           
  Misses       7181     7181           
  Partials      666      666           
Flag Coverage Δ
#windows 38.34% <ø> (ø)

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 83084c9...bbfa6fa. Read the comment docs.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 11, 2020

Build succeeded.

@payall4u payall4u force-pushed the bugfix-check-not-exist branch from cc54d8a to 96a356c Compare May 11, 2020 06:56
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 11, 2020

Build succeeded.

Comment thread .github/workflows/ci.yml Outdated
@payall4u payall4u force-pushed the bugfix-check-not-exist branch from 96a356c to 09b93eb Compare May 11, 2020 09:34
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 11, 2020

Build succeeded.

@payall4u payall4u force-pushed the bugfix-check-not-exist branch from 09b93eb to 831bd2d Compare May 11, 2020 09:51
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 11, 2020

Build succeeded.

@payall4u payall4u force-pushed the bugfix-check-not-exist branch from 831bd2d to bbfa6fa Compare May 11, 2020 10:51
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 11, 2020

Build succeeded.

Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

The change is LGTM basically.
Just need to add some comment and adjust error message

Comment thread container_test.go Outdated
Comment thread container_test.go Outdated
Comment thread container_test.go Outdated
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.

could you mind to add More information in https://github.com/containerd/containerd/pull/4214#discussion_r422769497 in other line? thanks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, and should I open issue on oci container-spec for runtime exception?

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.

Sure.

test case.

Signed-off-by: payall4u <[email protected]>

Add integration test case

Signed-off-by: payall4u <[email protected]>
@payall4u payall4u force-pushed the bugfix-check-not-exist branch from bbfa6fa to b437938 Compare May 11, 2020 13:56
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 11, 2020

Build succeeded.

Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@payall4u Thanks for your patience !

Copy link
Copy Markdown
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

@dmcgowan
Copy link
Copy Markdown
Member

@payall4u would you mind providing your real name for the author list. Thanks!

@payall4u
Copy link
Copy Markdown
Contributor Author

@payall4u would you mind providing your real name for the author list. Thanks!

@dmcgowan Zhiyu Li [email protected]. Should I add it into the list?

@dmcgowan
Copy link
Copy Markdown
Member

Thanks, I'll take care of it

@samba
Copy link
Copy Markdown

samba commented Jul 2, 2020

Are there any plans to backport this, to fix the problem in 1.3.x as well?

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.

8 participants