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

When attempting to kill a dead processes, do not return failure #1282

Closed
wants to merge 1 commit into from

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Aug 25, 2023

A race exists where a container engine tells crun to kill a container, process, where the process already died. In this case do not return an error.

Fixes: containers/podman#18452

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

Not sure why is it syncing libocispec in commit, coudl you remove libocispec sync.

@giuseppe
Copy link
Member

I am not sure this is correct though, runc returns an error when the container is not running:

$ runc kill foo 9
ERRO[0000] container not running  

I think it should be the caller to ignore the error, or check that the container is still running if kill failed.

@rhatdan
Copy link
Member Author

rhatdan commented Aug 26, 2023

Ok I think that Podman does ignore it, but an ugly message prints about "open pidfd" from crun, when this condition happens.

A race exists where a container engine tells crun to kill a container,
process, where the process already died. In this case do not return
an error.

Fixes: containers/podman#18452

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

We can improve the error message when the process is not found but I think we still need to return an error, otherwise there is no way to know if the signal was sent or not

@rhatdan
Copy link
Member Author

rhatdan commented Aug 26, 2023

Is there a way to silence the error, IE exit with non zero ESRCH but don't write to STDERR?

@giuseppe
Copy link
Member

what do you think of this alternative solution: containers/podman#19760 ?

@rhatdan rhatdan closed this Aug 28, 2023
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.

open pidfd: no such process
3 participants