-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
libpod: do not Cleanup() more than once #18462
Conversation
If the container was already cleaned up we should not try to do it again. Podman stop will always try to call Cleanup() if you look at the podman event log and just keep calling podman stop --all you see a cleanup event every time. This is not wanted. Also in case of the host pidns we report a error every single time, see the linked issue. Fixes containers#18460 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@mheon @vrothberg PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the test nit
LGTM
@@ -126,6 +126,12 @@ var _ = Describe("Podman stop", func() { | |||
finalCtrs.WaitWithDefaultTimeout() | |||
Expect(finalCtrs).Should(Exit(0)) | |||
Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) | |||
|
|||
// make sure we only have one cleanup event for this container | |||
events := podmanTest.Podman([]string{"events", "--since=30s", "--stream=false"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance we use a timestamp created at the beginning of the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could but each test uses their own event file so it shouldn't matter.
Sure, LGTM. I have vague concerns that we could somehow get a container in Exited that still had a network namespace associated with it through a cleanup failure, but even in this worst-case the only end result is a small resource leak that should fix itself on restarting the container. I'll hold off on a hold/lgtm until @vrothberg confirms that the tests are good. |
/lgtm |
/hold cancel |
If the container was already cleaned up we should not try to do it again. Podman stop will always try to call Cleanup() if you look at the podman event log and just keep calling podman stop --all you see a cleanup event every time. This is not wanted. Also in case of the host pidns we report a error every single time, see the linked issue.
Fixes #18460
Does this PR introduce a user-facing change?