Skip to content

Change lbu timeout #174

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

Merged
2 commits merged into from Nov 30, 2022
Merged

Change lbu timeout #174

2 commits merged into from Nov 30, 2022

Conversation

ghost
Copy link

@ghost ghost commented Nov 9, 2022

What type of PR is this?
/kind bug

What this PR does / why we need it:
Delete vm (for vm and loadbalancer) can be too long so it can execeded timeout.
Machine should be able to be destroyed with any state (provisioning, provisioned, running)
Also to have idempotency vm functions

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 #173
Fixes #106

Special notes for your reviewer:
It incluse also vm unit test refacto.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

@ghost
Copy link
Author

ghost commented Nov 9, 2022

Closes #106

@ghost
Copy link
Author

ghost commented Nov 9, 2022

Closes #173

@ghost ghost requested review from outscale-hmi and outscale-mdr November 10, 2022 10:49
@@ -206,7 +206,7 @@ func reconcileSecurityGroupRule(ctx context.Context, clusterScope *scope.Cluster
func deleteSecurityGroup(ctx context.Context, clusterScope *scope.ClusterScope, securityGroupId string, securityGroupSvc security.OscSecurityGroupInterface, clock_time clock.Clock) (reconcile.Result, error) {
clusterScope.Info("Check loadbalancer deletion")

currentTimeout := clock_time.Now().Add(time.Second * 20)
currentTimeout := clock_time.Now().Add(time.Second * 600)
Copy link
Contributor

Choose a reason for hiding this comment

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

one question, how did you end up choosing this numbers ? (600 rather than 20 for example? )

Copy link
Author

Choose a reason for hiding this comment

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

I test several values not to have (#173)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a remark but rather than setting timeouts, is it possible in case of failure to just try in the next reconciliation loop ?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Author

@ghost ghost Nov 23, 2022

Choose a reason for hiding this comment

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

It will be looked during this refacto #183 if you are ok ?

Comment on lines 539 to 535
err = vmSvc.CheckVmState(5, 120, "running", vmId)
err = vmSvc.CheckVmState(5, 240, "running", vmId)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

In the deletion process you check that the VM is running and fail if not ?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks.
You right.
In vpc, unlink does not depends on vm state.
And unlinkLoadBalancerBackendMachin does not depend on vm state.
I will remove it from reconcileDelete.

@ghost ghost requested review from outscale-mdr and outscale-hmi November 22, 2022 08:02
@ghost
Copy link
Author

ghost commented Nov 23, 2022

@outscale-mdr @outscale-hmi Are you ok with the latest changes ?

@ghost ghost assigned outscale-hmi Nov 24, 2022
Copy link
Contributor

@outscale-hmi outscale-hmi left a comment

Choose a reason for hiding this comment

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

LGTM

* Increase timeout to delete vm
* Machine can be destroyed with any state (provisonning, provisionned, running)
@ghost ghost merged commit af50d6c into outscale:main Nov 30, 2022
@ghost ghost added bug Something isn't working kind/bug Bug resolution and removed bug Something isn't working labels Nov 30, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug resolution
Development

Successfully merging this pull request may close these issues.

Deletion of Loadbalancer and vm exceed the timeout Idempotency of delete functions
3 participants