-
Notifications
You must be signed in to change notification settings - Fork 247
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
Conversation
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 <[email protected]>
Most likely just a cosmetic change. Signed-off-by: Valentin Rothberg <[email protected]>
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 <[email protected]>
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.
LGTM
LGTM |
// assumes that the flags value is always correct. | ||
return nil | ||
default: | ||
break |
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.
From staticcheck
as run by VS Code:
ineffective break statement. Did you mean to break out of the outer loop? (SA4011)
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.
Thanks for spotting and reporting!
I keep forgetting the break semantics. Opened #1401 to fix it.
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?