-
Notifications
You must be signed in to change notification settings - Fork 25
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
Increase timeout of csi-provisioner and csi attacher #93
Conversation
csi-attacher. This fixes random failures in the k8s e2e test. Cleaned up some linter issues with using deprecated functions. Ignore server rejection errors from kubevirt addvolume/removevolume and retry them. Signed-off-by: Alexander Wels <awels@redhat.com>
/test pull-csi-driver-linter |
@@ -60,7 +58,6 @@ func init() { | |||
|
|||
func main() { | |||
flag.Parse() | |||
rand.Seed(time.Now().UnixNano()) |
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.
why was this removed?
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.
Because it is not needed anymore, rand.Seed is deprecated, and according to the documentation if you don't initialize the Random with a particular seed, it gets a random seed on startup.
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.
Okay so the automatic seed population doesn't happen automatically until golang 1.20, I will restore this until we update golang to be 1.20
pkg/service/controller.go
Outdated
if attached, err := c.isVolumeAttached(dvName, vmName); err != nil { | ||
return nil, err |
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.
I don't think you need this check. The c.addVolumeToVm()
invocation immediately checks isVolumeAttached()
before attempting to add the volume
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.
Good point, removed.
pkg/service/controller.go
Outdated
retryCount := 6 | ||
for retryCount > 0 { | ||
retryCount-- |
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.
typically we use wait.PollImmediate
for loops like this.
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.
Good point, added, less code also.
pkg/service/controller.go
Outdated
if attached, err := c.isVolumeAttached(dvName, vmName); err != nil { | ||
return nil, err | ||
} else if attached { |
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.
the removeVolumeFromVM()
already checks to see if the volume is attached before attempting to remove it.
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.
Good point, removed.
pkg/service/controller.go
Outdated
for retryCount > 0 { | ||
retryCount-- |
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.
another candidate for wait.PollImmediate
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.
Yup
Aligned retry-interval-max between csi-provisioner and csi-attacher Signed-off-by: Alexander Wels <awels@redhat.com>
d1d6bd3
to
1c92791
Compare
/retest-required |
Signed-off-by: Alexander Wels <awels@redhat.com>
/test pull-csi-driver-sanity-test |
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidvossel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
kubevirt/csi-driver#93 updated the timeouts of the csi-provisioner and csi-attacher to be 3 minutes instead of 15 seconds to avoid the timeout happening while waiting for disk to hotplug. This commit modifies the controller deployment and daemonset to match that PR Signed-off-by: Alexander Wels <awels@redhat.com>
* Increased timeout of csi-provisioner and csi-attacher. This fixes random failures in the k8s e2e test. Cleaned up some linter issues with using deprecated functions. Ignore server rejection errors from kubevirt addvolume/removevolume and retry them. Signed-off-by: Alexander Wels <awels@redhat.com> * Address review comments. Aligned retry-interval-max between csi-provisioner and csi-attacher Signed-off-by: Alexander Wels <awels@redhat.com> * Use exponetial backoff instead of poll immediate Signed-off-by: Alexander Wels <awels@redhat.com> --------- Signed-off-by: Alexander Wels <awels@redhat.com>
* Increased timeout of csi-provisioner and csi-attacher. This fixes random failures in the k8s e2e test. Cleaned up some linter issues with using deprecated functions. Ignore server rejection errors from kubevirt addvolume/removevolume and retry them. Signed-off-by: Alexander Wels <awels@redhat.com> * Address review comments. Aligned retry-interval-max between csi-provisioner and csi-attacher Signed-off-by: Alexander Wels <awels@redhat.com> * Use exponetial backoff instead of poll immediate Signed-off-by: Alexander Wels <awels@redhat.com> --------- Signed-off-by: Alexander Wels <awels@redhat.com>
kubevirt/csi-driver#93 updated the timeouts of the csi-provisioner and csi-attacher to be 3 minutes instead of 15 seconds to avoid the timeout happening while waiting for disk to hotplug. This commit modifies the controller deployment and daemonset to match that PR Signed-off-by: Alexander Wels <awels@redhat.com>
What this PR does / why we need it:
Increased timeout of csi-provisioner and csi-attacher. This fixes random failures in the k8s e2e test. Cleaned up some linter issues with using deprecated functions.
Ignore server rejection errors from kubevirt addvolume/removevolume and retry them.
Put proper log levels on messages so it is easier to control the
logging in the csi-driver pod. Added some extra logging to easier identify issues once the log level is set high enough.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
See these links for what the arguments do
https://github.com/kubernetes-csi/external-provisioner
https://github.com/kubernetes-csi/external-attacher
Release note: