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

asyncpoller fails when SDK PollUntilDone returns a Done poller #3970

Closed
nojnhuh opened this issue Sep 7, 2023 · 2 comments · Fixed by #4011
Closed

asyncpoller fails when SDK PollUntilDone returns a Done poller #3970

nojnhuh opened this issue Sep 7, 2023 · 2 comments · Fixed by #4011
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@nojnhuh
Copy link
Contributor

nojnhuh commented Sep 7, 2023

/kind bug

What steps did you take and what happened:

This AKS test run failed to delete an AzureManagedMachinePool: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-azure/3932/pull-cluster-api-provider-azure-e2e-aks/1699797265842966528

The following appears in the logs several times:

E0907 16:04:55.072224       1 controller.go:324]  "msg"="Reconciler error" "error"="error deleting AzureManagedMachinePool capz-e2e-8c0xmy/poolspot: failed to delete machine pool poolspot: failed to convert poller to future: failed to get resume token: poller is in a terminal state" "AzureManagedMachinePool"={"name":"poolspot","namespace":"capz-e2e-8c0xmy"} "controller"="azuremanagedmachinepool" "controllerGroup"="infrastructure.cluster.x-k8s.io" "controllerKind"="AzureManagedMachinePool" "name"="poolspot" "namespace"="capz-e2e-8c0xmy" "reconcileID"="bde3f505-a842-41f2-b11a-9bd4058eddcc"

Other runs:

What did you expect to happen:

Anything else you would like to add:

It looks like the call to DeleteAsync in asyncpoller.go is returning a non-nil poller where poller.Done() == true. There are a few things I noticed that might help in coming up with a fix, but it's not obvious to me the best route to take:

  • The err returned by the call to DeleteAsync in asyncpoller.go is not checked when poller != nil.
  • The poller returned in the same call is not checked if it's .Done() before ultimately it's .ResumeToken() method is called, which fails when the poller is done. This directly correlates to the above error message form the CAPZ logs.
  • If the poller is Done, might we find an error in its .Result()?

The same issue likely affects the CreateOrUpdate flow as well.

Environment:

  • cluster-api-provider-azure version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

fyi @mboersma

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 7, 2023
@CecileRobertMichon
Copy link
Contributor

/milestone v1.11

@nojnhuh
Copy link
Contributor Author

nojnhuh commented Sep 19, 2023

/assign

@dtzar dtzar added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants