-
Notifications
You must be signed in to change notification settings - Fork 554
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
fixed csi-rbdplugin crashes when decoding volume ID(CSI identifier) failed #4099
Conversation
Duplicate of #4002 |
I think my solution is better. |
internal/rbd/controllerserver.go
Outdated
if err != nil { | ||
return cs.checkErrAndUndoReserve(ctx, err, volumeID, rbdVol, cr) | ||
} | ||
defer rbdVol.Destroy() |
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.
Please note that this case lead to the memory leak problem as rbdVol is returned even in case of error from GenVolFromVolID function
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.
If there is an error, GenVolFromVolID()
should not return a connected rbdVol
... If that is the case, GenVolFromVolID()
should be corrected too.
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.
Please note that this case lead to the memory leak problem as rbdVol is returned even in case of error from GenVolFromVolID function
Oh I see, maybe GenVolFromVolID funtion returns error though, the connection has established.
Pull request has been modified.
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.
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
@Mergifyio rebase |
Signed-off-by: HF <crazytaxii666@gmail.com>
✅ Branch has been successfully rebased |
/test ci/centos/upgrade-tests-cephfs |
/test ci/centos/k8s-e2e-external-storage/1.26 |
/test ci/centos/k8s-e2e-external-storage/1.27 |
/test ci/centos/upgrade-tests-rbd |
/test ci/centos/mini-e2e-helm/k8s-1.26 |
/test ci/centos/mini-e2e-helm/k8s-1.27 |
/test ci/centos/mini-e2e/k8s-1.26 |
/test ci/centos/k8s-e2e-external-storage/1.28 |
/test ci/centos/mini-e2e/k8s-1.27 |
/test ci/centos/mini-e2e-helm/k8s-1.28 |
/test ci/centos/mini-e2e/k8s-1.28 |
/retest ci/centos/mini-e2e-helm/k8s-1.27 |
/retest ci/centos/upgrade-tests-rbd |
Describe what this PR does
csi-rbdplugin will crash when decoding volume ID failed due to nil pointer
Related issues
#4098
Closes: #4002