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

Increase timeout of csi-provisioner and csi attacher #93

Merged
merged 3 commits into from
Sep 22, 2023

Conversation

awels
Copy link
Member

@awels awels commented Sep 21, 2023

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:

Increased timeout for csi-provisioner and csi-attacher

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>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Sep 21, 2023
@awels awels changed the title Increased timeout of csi-provisioner and Increased timeout of csi-provisioner and csi attacher Sep 21, 2023
@awels
Copy link
Member Author

awels commented Sep 21, 2023

/test pull-csi-driver-linter

@awels awels changed the title Increased timeout of csi-provisioner and csi attacher Increase timeout of csi-provisioner and csi attacher Sep 21, 2023
@@ -60,7 +58,6 @@ func init() {

func main() {
flag.Parse()
rand.Seed(time.Now().UnixNano())
Copy link
Member

Choose a reason for hiding this comment

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

why was this removed?

Copy link
Member Author

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.

Copy link
Member Author

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

Comment on lines 249 to 250
if attached, err := c.isVolumeAttached(dvName, vmName); err != nil {
return nil, err
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, removed.

Comment on lines 272 to 274
retryCount := 6
for retryCount > 0 {
retryCount--
Copy link
Member

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.

Copy link
Member Author

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.

Comment on lines 353 to 355
if attached, err := c.isVolumeAttached(dvName, vmName); err != nil {
return nil, err
} else if attached {
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, removed.

Comment on lines 357 to 358
for retryCount > 0 {
retryCount--
Copy link
Member

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

Copy link
Member Author

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>
@awels
Copy link
Member Author

awels commented Sep 22, 2023

/retest-required

Signed-off-by: Alexander Wels <awels@redhat.com>
@awels
Copy link
Member Author

awels commented Sep 22, 2023

/test pull-csi-driver-sanity-test

Copy link
Member

@davidvossel davidvossel left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 22, 2023
@kubevirt-bot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 22, 2023
@kubevirt-bot kubevirt-bot merged commit 8250632 into kubevirt:main Sep 22, 2023
7 of 8 checks passed
awels added a commit to awels/hypershift that referenced this pull request Sep 25, 2023
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>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/kubevirt-csi-driver that referenced this pull request Sep 25, 2023
* 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>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/kubevirt-csi-driver that referenced this pull request Sep 25, 2023
* 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>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/hypershift that referenced this pull request Sep 25, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants