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

🐛 Revert: move health probes to runnable #2321

Merged
merged 1 commit into from
May 11, 2023

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented May 11, 2023

This PR reverts part of: #2275

On main we have the following sequence in controllerManager.Start():

  • ...
  • add health probe server
  • ...
  • Start webhook runnables
  • Start cache runnables
  • Start other runnables (including health probe server)

Usually this works except under the following circumstances (concrete example):

  • The controller implements a reconciler for a CRD called MachineDeployment
  • MachineDeployment has multiple apiVersions and thus the controller also implements a conversion webhook
  • There are MachineDeployments in the older apiVersion stored in etcd

Now we have the following problem:

  • Start cache runnables fails because caches are not getting ready
  • Caches are not getting ready because MachineDeployment list does not work
  • MachineDeployment list does not work because the conversion webhook does not work ("Post "https://capi-webhook-service.capi-system.svc:443/convert?timeout=30s\": dial tcp 10.142.135.97:443: connect: connection refused")
  • conversion webhook does not work because the service/pod does not get ready
  • Pod does not get ready because health probes are not started
  • health probes are not started because cache does not get ready

tl;dr cyclic dependency between start caches and start runnables.

This PR solves this by immediately starting the health probes again.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 11, 2023
@sbueringer
Copy link
Member Author

/assign @vincepri @alvaroaleman

/hold
I'll verify with Cluster API if the deadlock is gone before merge

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 11, 2023
@sbueringer
Copy link
Member Author

/hold cancel

Ran the Cluster API test with the CR version from this PR locally and everything works as expected again.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 11, 2023
@sbueringer
Copy link
Member Author

(cc just fyi @zqzten, we're reverting this part for now to ensure CR main works again, we can work on a new implementation independent of that)

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer, vincepri

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:
  • OWNERS [sbueringer,vincepri]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 92646a5 into kubernetes-sigs:main May 11, 2023
@sbueringer sbueringer deleted the pr-fix-deadlock branch May 11, 2023 16:26
@zqzten
Copy link
Member

zqzten commented May 12, 2023

I think we can introduce a new "basics" runnable group which includes the previous internal servers and start it before any other runnable groups, this seems to solve the dead lock issue here. wdyt @sbueringer

@sbueringer
Copy link
Member Author

I think we can introduce a new "basics" runnable group which includes the previous internal servers and start it before any other runnable groups, this seems to solve the dead lock issue here. wdyt @sbueringer

Yup, something like this would work.

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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants