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

fix(service): run only single attach/detach operation simultaneously #94

Merged
merged 3 commits into from
Oct 24, 2023

Conversation

peknur
Copy link
Contributor

@peknur peknur commented Oct 11, 2023

Run only single attach/detach operation simultaneously per node.

CSI attacher sidecar runs multiple goroutines (10 by default) that handle volume attachments and that will lead many SERVER_STATE_ILLEGAL errors when driver tries to do those operations concurrently towards the same node. Those operations succeed eventually but those cause unnecessary load to backend and increased pod deployment times.

This PR tries to solve that problem by using mutex lock per node when executing ControllerPublishVolume and ControllerUnpublishVolume methods.

@peknur peknur requested a review from ajmyyra October 23, 2023 05:59
Copy link
Member

@ajmyyra ajmyyra left a comment

Choose a reason for hiding this comment

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

One comment/question but otherwise seems good.

internal/service/mock/upcloud_client.go Show resolved Hide resolved
@peknur peknur merged commit 854cbca into main Oct 24, 2023
2 checks passed
@peknur peknur deleted the fix/controller-attacher-concurrency branch October 24, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants