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

csi: prevent in-use plugin GC from blocking volume GC #9141

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

tgross
Copy link
Member

@tgross tgross commented Oct 21, 2020

Fixes an issue noticed in #8949 (comment)

During CSI plugin GC, we don't return an error if the volume is in use,
because this is not an error condition. If we were to return an error during a
nomad system gc, we would not continue on to GC volumes.

But the check for the specific error message fails if the GC is performed on a
worker rather than on the leader, due to RPC forwarding wrapping the error
message. Use a less specific test so that we don't return an error.

During CSI plugin GC, we don't return an error if the volume is in use,
because this is not an error condition. If we were to return an error during a
`nomad system gc`, we would not continue on to GC volumes.

But check for the specific error message fails if the GC is performed on a
worker rather than on the leader, due to RPC forwarding wrapping the error
message. Use a less specific test so that we don't return an error.
Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

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

This kinda feels like something Go's newish errors.Is/As are supposed to help with, but I'm guessing the RPC machinery isn't helping with that

@tgross
Copy link
Member Author

tgross commented Oct 21, 2020

I'm guessing the RPC machinery isn't helping with that

Yeah, totally. I've been able to use it a few other places in CSI but we need to get %w threaded through the rest of the RPC to really make it work.

@tgross tgross merged commit fc1b0c1 into master Oct 21, 2020
@tgross tgross deleted the b-csi-plugin-gc-error branch October 21, 2020 20:54
fredrikhgrelland pushed a commit to fredrikhgrelland/nomad that referenced this pull request Oct 22, 2020
During CSI plugin GC, we don't return an error if the volume is in use,
because this is not an error condition. If we were to return an error during a
`nomad system gc`, we would not continue on to GC volumes.

But check for the specific error message fails if the GC is performed on a
worker rather than on the leader, due to RPC forwarding wrapping the error
message. Use a less specific test so that we don't return an error.
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants