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

🐛 Ensure returned informers are always correctly synced #371

Merged

Conversation

nvachhar
Copy link

specificInformersMap.Get may accidentally return an unsynced Informer (contained in the returned MapEntry). The condition occurs when 2 callers concurrently call Get for the same GVK after the specificInformersMap has been started. The first won't find the GVK in the cache. It will add it and wait for the informer to sync. The second will find it in the cache and erroneously return it before it syncs.This patch guarantees that all returned informers are synced by checking before return.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 25, 2019
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 25, 2019
@nvachhar
Copy link
Author

/assign @DirectXMan12

@nvachhar
Copy link
Author

Fixes #370

@nvachhar
Copy link
Author

I'm working on the contributor agreement. Stay tuned. We had previously signed with Google before things moved over to CNCF, so I just have to get a new signature.

@nvachhar
Copy link
Author

nvachhar commented Apr 1, 2019

CNCF agreement is now signed. Should be ready for review.

@nvachhar
Copy link
Author

nvachhar commented Apr 1, 2019

Changed my github primary email. Maybe that'll help...

@nvachhar
Copy link
Author

nvachhar commented Apr 1, 2019

One more try. Logged into CNCF with github...

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 1, 2019
Copy link
Contributor

@DirectXMan12 DirectXMan12 left a comment

Choose a reason for hiding this comment

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

I think this tackles the case we care about satisfactorily. There's a bit of pseudo-UB if you fetch an informer while you're starting the cache, though.

@DirectXMan12
Copy link
Contributor

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DirectXMan12, nvachhar

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 5, 2019
@k8s-ci-robot k8s-ci-robot merged commit 962ab1f into kubernetes-sigs:master Apr 5, 2019
@nvachhar
Copy link
Author

A quick question for future contributions. What is pseudo-UB? I racked my brain trying to figure it out, but came up short...

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.

None yet

3 participants