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

Delay start of informers in sharedmain #1767

Merged

Conversation

zhongduo
Copy link
Contributor

@zhongduo zhongduo commented Oct 2, 2020

The EnableInjectionOrDie starts informers immedidately in a go
routine, which changes the order of informer start and controller
setup. As a result setting resync period to informer handler will
be ignored as the informer is already started. Though this will
likely affect more components, changing the EnableInjectionOrDie
function will break the API, so this is a temporary solution to
fix all the controllers depending on sharedmain.

This is a temporary solution to #1757 . We might change it to
use whatever solution #1757 will result in, but for now this can be
an easy fix for controllers depending on sharedmain.

The EnableInjectionOrDie starts informers immedidately in a go
routine, which changes the order of informer start and controller
setup. As a result setting resync period to informer handler will
be ignored as the informer is already started. Though this will
likely affect more components, changing the EnableInjectionOrDie
function will break the API, so this is a temporary solution to
fix all the controllers depending on sharedmain.
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 2, 2020
@knative-prow-robot knative-prow-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 2, 2020
@zhongduo
Copy link
Contributor Author

zhongduo commented Oct 2, 2020

/assign @grantr

@zhongduo
Copy link
Contributor Author

zhongduo commented Oct 2, 2020

/assign @n3wscott

@codecov
Copy link

codecov bot commented Oct 2, 2020

Codecov Report

Merging #1767 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1767      +/-   ##
==========================================
+ Coverage   68.48%   68.53%   +0.04%     
==========================================
  Files         215      215              
  Lines        9202     9216      +14     
==========================================
+ Hits         6302     6316      +14     
  Misses       2584     2584              
  Partials      316      316              
Impacted Files Coverage Δ
apis/contexts.go 100.00% <0.00%> (ø)
test/gcs/mock/mock.go 91.39% <0.00%> (ø)
test/helpers/name.go 94.28% <0.00%> (+2.98%) ⬆️

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 1e373a9...282b4b5. Read the comment docs.

@n3wscott
Copy link
Contributor

n3wscott commented Oct 3, 2020

/lgtm
/approve

We can follow up next week with a fix to enable injection.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 3, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: n3wscott, zhongduo

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 3, 2020
@knative-prow-robot knative-prow-robot merged commit ea7374e into knative:master Oct 3, 2020
@zhongduo
Copy link
Contributor Author

zhongduo commented Oct 5, 2020

We can follow up next week with a fix to enable injection.

Hi @n3wscott I am not sure about the process, but my original plan is to update my go.mod and regenerate the vendor directory. Are you saying that all the knative shared libraries, like this pkg repo, is normally updated from the upstream?

n3wscott pushed a commit to n3wscott/pkg that referenced this pull request Oct 23, 2020
The EnableInjectionOrDie starts informers immedidately in a go
routine, which changes the order of informer start and controller
setup. As a result setting resync period to informer handler will
be ignored as the informer is already started. Though this will
likely affect more components, changing the EnableInjectionOrDie
function will break the API, so this is a temporary solution to
fix all the controllers depending on sharedmain.
knative-prow-robot pushed a commit that referenced this pull request Oct 23, 2020
The EnableInjectionOrDie starts informers immedidately in a go
routine, which changes the order of informer start and controller
setup. As a result setting resync period to informer handler will
be ignored as the informer is already started. Though this will
likely affect more components, changing the EnableInjectionOrDie
function will break the API, so this is a temporary solution to
fix all the controllers depending on sharedmain.

Co-authored-by: Zhongduo Lin (Jimmy) <zhongduo@google.com>
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants