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

container deletion - EBUSY improvement #1382

Merged
merged 3 commits into from Oct 13, 2022
Merged

Conversation

vrothberg
Copy link
Member

A couple of beatifications along with a change in hope to improve on containers/podman/issues/11594. Please refer to the individual commits.

@giuseppe @nalind @rhatdan WDYT?

Return early instead of having a large body in nested branches.
Preserve the logic of returning ErrNotAContainer even on Get().

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Most likely just a cosmetic change.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
The function is being used in a number of places, notably container
removal and cleanup.  While container removal already loops over EBUSY,
cleanup does not.

To make sure that all callers of Unmount get a fair chance of unmounting
cleanly, also loop there.  I used the same values as containerd: 50
loops with 50ms sleeps.

Context: containers/podman/issues/11594
Signed-off-by: Valentin Rothberg <vrothberg@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.

LGTM

@rhatdan rhatdan changed the title [RFC] container deletion - EBUSY improvement container deletion - EBUSY improvement Oct 13, 2022
@rhatdan
Copy link
Member

rhatdan commented Oct 13, 2022

LGTM

@rhatdan rhatdan merged commit cdd951c into containers:main Oct 13, 2022
@vrothberg vrothberg deleted the del-ctr branch October 13, 2022 14:41
// assumes that the flags value is always correct.
return nil
default:
break
Copy link
Collaborator

Choose a reason for hiding this comment

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

From staticcheck as run by VS Code:

ineffective break statement. Did you mean to break out of the outer loop? (SA4011)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for spotting and reporting!

I keep forgetting the break semantics. Opened #1401 to fix it.

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.

None yet

4 participants