libpod: do not Cleanup() more than once#18462
libpod: do not Cleanup() more than once#18462openshift-merge-robot merged 1 commit intocontainers:mainfrom
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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@mheon @vrothberg PTAL |
vrothberg
left a comment
There was a problem hiding this comment.
Other than the test nit
LGTM
| 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.
Any chance we use a timestamp created at the beginning of the test?
There was a problem hiding this comment.
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?