-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Fix a race condition in SharedInformer #59828
Fix a race condition in SharedInformer #59828
Conversation
This prevents a race condition where the sharedIndexInformer was causeing the processorListener's run and pop method to be started twice. That violated the SharedInformer's interface guarantee of sequential delivery and also caused panics on shutdown.
Without the fix, I was able to use golang.org/x/tools/cmd/stress to generate about 76 panics in 31000 runs with the following: > go test -c
> stress cache.test -test.run=TestSharedInformerInitializationRace After the fix in the second commit, I got 0 failures in 870,000 runs. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jennybuckley, krousey 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 OWNERS Files:
Approvers can indicate their approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
How far does this need to be backported? @kubernetes/sig-api-machinery-bugs |
@smarterclayton I came upon this while testing a controller using the 1.8 release libraries. I would like at least that far back to make my life easier. |
@krousey - great finding! LGTM |
/cc @roycaihw @wenjiaswe |
@mbohlool: GitHub didn't allow me to request PR reviews from the following users: wenjiaswe. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
/lgtm |
@mbohlool can we approve this for the 1.9 branch yet? |
Commit found in the "release-1.9" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
re-adding cherrypick-candidate for debugging |
What this PR does / why we need it:
This fixes a race condition that can occur in the
sharedIndexInformer
Which issue(s) this PR fixes:
Fixes #59822
Release note: