Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libct: suppress bogus "unable to terminate" warnings #2716

Merged
merged 2 commits into from
Jan 22, 2021

Conversation

kolyshkin
Copy link
Contributor

While working on a test case for #2715, I got the following warning:

level=warning msg="unable to terminate initProcess" error="exit status 1"

Obviously, the warning is bogus since the initProcess is terminated.

This is happening because terminate() can return errors from either
Kill() or Wait(), and the latter returns an error if the process has
not finished successfully (i.e. exit status is not 0 or it was killed).

Check for a particular error type and filter out those errors.

While working on a test case for [1], I got the following warning:

> level=warning msg="unable to terminate initProcess" error="exit status 1"

Obviously, the warning is bogus since the initProcess is terminated.

This is happening because terminate() can return errors from either
Kill() or Wait(), and the latter returns an error if the process has
not finished successfully (i.e. exit status is not 0 or it was killed).

Check for a particular error type and filter out those errors.

[1] opencontainers#2683

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This is a new variable added by go 1.16 so we'll have to wait
until 1.16 is minimally supported version, thus TODO for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
Copy link
Contributor Author

rebased (for new CI)

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

@mrunalp ptal

@kolyshkin
Copy link
Contributor Author

Just saw it again and it took me some time to find out I already had it fixed:

time="2021-01-21T18:16:28-08:00" level=warning msg="unable to terminate setnsProcess" error="signal: terminated"

@@ -2067,9 +2067,20 @@ func ignoreTerminateErrors(err error) error {
if err == nil {
return nil
}
// terminate() might return an error from ether Kill or Wait.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: ether -> either

@mrunalp mrunalp merged commit c69ae75 into opencontainers:master Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants