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

Ensure cloudprovider.InstanceNotFound is reported when the VM is not found on Azure #61531

Merged
merged 1 commit into from
Mar 27, 2018

Conversation

feiskyer
Copy link
Member

@feiskyer feiskyer commented Mar 22, 2018

What this PR does / why we need it:

Azure ExponentialBackoff will still try to get VM information even when the VM has already been removed on Azure:

err := wait.ExponentialBackoff(az.requestBackoff(), func() (bool, error) {
machine, retryErr = az.getVirtualMachine(name)
if retryErr != nil {
glog.Errorf("backoff: failure, will retry,err=%v", retryErr)
return false, nil
}
glog.V(2).Info("backoff: success")
return true, nil
})

It should report cloudprovider.InstanceNotFound early and avoid calling Azure APIs on such case.

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 #61465

Special notes for your reviewer:

Should be cherry-picked to v1.9

Release note:

Ensure cloudprovider.InstanceNotFound is reported when the VM is not found on Azure

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 22, 2018
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 22, 2018
@feiskyer
Copy link
Member Author

/sig azure
/kind bug

@k8s-ci-robot k8s-ci-robot added sig/azure kind/bug Categorizes issue or PR as related to a bug. labels Mar 22, 2018
@@ -51,6 +52,9 @@ func (az *Cloud) GetVirtualMachineWithRetry(name types.NodeName) (compute.Virtua
var retryErr error
err := wait.ExponentialBackoff(az.requestBackoff(), func() (bool, error) {
machine, retryErr = az.getVirtualMachine(name)
if retryErr == cloudprovider.InstanceNotFound {
return false, cloudprovider.InstanceNotFound
Copy link
Contributor

Choose a reason for hiding this comment

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

should be true to prevent retrying?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@feiskyer
Copy link
Member Author

/retest

@feiskyer
Copy link
Member Author

ping @karataliu @andyzhangx

@karataliu
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 26, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, karataliu

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

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 61434, 61501, 59609, 61467, 61531). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 79e1297 into kubernetes:master Mar 27, 2018
@feiskyer feiskyer deleted the delete-node branch March 27, 2018 03:28
k8s-github-robot pushed a commit that referenced this pull request Mar 30, 2018
…31-upstream-release-1.9

Automatic merge from submit-queue.

Automated cherry pick of #61531: Ensure cloudprovider.InstanceNotFound is reported when the VM is not found on Azure

Cherry pick of #61531 on release-1.9.

#61531: Ensure cloudprovider.InstanceNotFound is reported when the VM is not found on Azure
k8s-github-robot pushed a commit that referenced this pull request Mar 30, 2018
…31-upstream-release-1.10

Automatic merge from submit-queue.

Automated cherry pick of #61531: Ensure cloudprovider.InstanceNotFound is reported when the VM is not found on Azure

Cherry pick of #61531 on release-1.10.

#61531: Ensure cloudprovider.InstanceNotFound is reported when the VM is not found on Azure
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node objects are not removed from etcd for deleted Azure VMs
4 participants