-
Notifications
You must be signed in to change notification settings - Fork 4k
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
simplify DeleteNode logic by removing an extra Mutex #3573
simplify DeleteNode logic by removing an extra Mutex #3573
Conversation
/assign @RainbowMango |
/assign @MaciekPytel |
any comments? |
/assign @kevin-wangzefeng |
@@ -185,7 +185,6 @@ func getAutoscaleNodePools(manager *huaweicloudCloudManager, opts config.Autosca | |||
} | |||
|
|||
clusterUpdateLock := sync.Mutex{} | |||
deleteMux := sync.Mutex{} | |||
|
|||
// Given our current implementation just support single node pool, |
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.
No problem here, but need to point out that the clusterUpdateLock
and deleteMux
should be defined in the loop so that we can ensure the same mutex can't be shared with different node groups.
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.
Yeah you're right. I'll move the clusterUpdateLock inside the for loop below. Thank you for the comment!
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango 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 |
Previously, two mutexes are used in the logic of removing a node from a node pool. Now only one mutex is used to simplify the logic and the time for removing a node can be shortened with this logic since it doesn't always have to wait for a certain time length before being deleted.