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

Wait for reconciler/controllers to return prior to exiting the sharedmain process #2437

Merged

Conversation

dprotaso
Copy link
Member

Fixes: #2436

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso

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

@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 22, 2022
Comment on lines +269 to +271
eg.Go(func() error {
return controller.StartAll(ctx, controllers...)
})
Copy link
Member Author

Choose a reason for hiding this comment

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

note: the other changes are just a minor clean up. Running this in an error group which Waits below is the fix

@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #2437 (5dcf4aa) into main (3b550af) will increase coverage by 0.01%.
The diff coverage is 70.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2437      +/-   ##
==========================================
+ Coverage   63.49%   63.50%   +0.01%     
==========================================
  Files         228      228              
  Lines        9996     9991       -5     
==========================================
- Hits         6347     6345       -2     
+ Misses       3346     3343       -3     
  Partials      303      303              
Impacted Files Coverage Δ
injection/sharedmain/main.go 5.55% <0.00%> (-0.08%) ⬇️
controller/controller.go 88.01% <100.00%> (+1.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d481724...5dcf4aa. Read the comment docs.

@dprotaso
Copy link
Member Author

Looks like eventing keda was using the deprecated method - knative-extensions/eventing-autoscaler-keda#243

for _, controller := range controllers {
c := controller
eg.Go(func() error {
return c.Run(egCtx)
Copy link
Member

Choose a reason for hiding this comment

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

can't you run the c.RunContext directly?

Copy link
Member Author

@dprotaso dprotaso Feb 22, 2022

Choose a reason for hiding this comment

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

no - errgroup.Go doesn't pass through a ctx to the function - otherwise we could

@nader-ziada
Copy link
Member

looks good, but tests failing

@dprotaso
Copy link
Member Author

The failures are known flakes/unrelated - excluding the keda change

@nader-ziada
Copy link
Member

The failures are known flakes/unrelated - excluding the keda change

I was just looking at the keda one, can we ignore that?

@dprotaso
Copy link
Member Author

I created a PR fix which is linked above

@nader-ziada
Copy link
Member

/retest

for the flaky knaitve one

@nader-ziada
Copy link
Member

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2022
@knative-prow-robot knative-prow-robot merged commit 80c511a into knative:main Feb 22, 2022
@dprotaso
Copy link
Member Author

/cherry-pick release-1.2

@dprotaso
Copy link
Member Author

/cherry-pick release-1.1

@dprotaso
Copy link
Member Author

/cherry-pick release-1.0

@dprotaso
Copy link
Member Author

/cherry-pick release-0.26

@dprotaso dprotaso deleted the graceful-controller-shutdown branch February 22, 2022 21:34
@knative-prow-robot
Copy link
Contributor

@dprotaso: new pull request created: #2438

In response to this:

/cherry-pick release-1.2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot
Copy link
Contributor

@dprotaso: new pull request created: #2439

In response to this:

/cherry-pick release-1.1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot
Copy link
Contributor

@dprotaso: new pull request created: #2440

In response to this:

/cherry-pick release-1.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot
Copy link
Contributor

@dprotaso: new pull request created: #2441

In response to this:

/cherry-pick release-0.26

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. lgtm 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.

Controllers (and related) should relinquish their leases when shutting down
3 participants