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

Fix a problem with multiple APIs clobbering each other in registration. #28431

Merged
merged 2 commits into from
Jul 22, 2016

Conversation

brendandburns
Copy link
Contributor

@brendandburns brendandburns commented Jul 3, 2016

Fixes #24392

@kubernetes/sig-api-machinery

Analytics


This change is Reviewable

@brendandburns brendandburns added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. cherrypick-candidate labels Jul 3, 2016
@brendandburns brendandburns added this to the v1.4 milestone Jul 3, 2016
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Jul 3, 2016
@lavalamp
Copy link
Member

lavalamp commented Jul 6, 2016

Please add a test

@lavalamp lavalamp assigned lavalamp and caesarxuchao and unassigned dchen1107 and lavalamp Jul 6, 2016
@caesarxuchao
Copy link
Member

@polvi I don't follow your comment in the original issue: "there appears to be a race in kubectl for the ability to read the APIs". I think kubectl is single-threaded, why would there be a race?

I think this PR is correct in that appending filteredGVs to thirdPartyGroupVersions, but I don't understand why @polvi observed on and off error in the original issue, I expect it to always fail.

@brendandburns
Copy link
Contributor Author

@caesarxuchao it's not actually a race. It's actually because of Golang's randomized map iteration "feature" (I think)

So you load in two APIs on the same path, depending the randomness you iterate them in potentially different orders which makes different APIs found (or not).

I will add a test.

@brendandburns brendandburns added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Jul 8, 2016
@caesarxuchao
Copy link
Member

Right, the randomness comes from the map here: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/util/factory.go#L294

@brendandburns
Copy link
Contributor Author

@lavalamp test added, ptal.

Thanks

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 8, 2016
@caesarxuchao
Copy link
Member

LGTM. Thanks!

@caesarxuchao caesarxuchao added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 8, 2016
@@ -70,6 +74,16 @@ func init() {
}
}

// Resets everything to clean room for the start of a test
func clearForTesting() {
Copy link
Member

Choose a reason for hiding this comment

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

ugh, this is awful, I really need to get my changes in so it's not necessary :(

@brendandburns
Copy link
Contributor Author

@k8s-bot e2e test this please issue: #27920

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@roberthbailey
Copy link
Contributor

@brendandburns do you want to cherry pick this into the 1.3 branch?

@k8s-bot
Copy link

k8s-bot commented Jul 20, 2016

GCE e2e build/test passed for commit 891bd3e.

@brendandburns
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@brendandburns
Copy link
Contributor Author

@roberthbailey yeah, I'll prepare a cherry pick once this is in.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jul 22, 2016

GCE e2e build/test passed for commit 891bd3e.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit e9e774c into kubernetes:master Jul 22, 2016
@fabioy fabioy added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Jul 24, 2016
@goltermann
Copy link
Contributor

@brendandburns @pwittrock This is in v1.4 milestone, but with cherrypick tags. Is the intent still to get into 1.3.x at some point?

@brendandburns
Copy link
Contributor Author

We're close enough to 1.4 that we can probably wait.

--brendan


From: goltermann notifications@github.com
Sent: Saturday, August 27, 2016 11:24:24 AM
To: kubernetes/kubernetes
Cc: Brendan Burns; Mention
Subject: Re: [kubernetes/kubernetes] Fix a problem with multiple APIs clobbering each other in registration. (#28431)

@brendandburnshttps://github.com/brendandburns @pwittrockhttps://github.com/pwittrock This is in v1.4 milestone, but with cherrypick tags. Is the intent still to get into 1.3.x at some point?

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//pull/28431#issuecomment-242932850, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFfDgrOuSFeGSsGsei51sQA1Zv_eKRBPks5qkIDYgaJpZM4JDzsC.

@foxish
Copy link
Contributor

foxish commented Sep 8, 2016

Removing cherrypick tags for now, as this change is already in the 1.4 branch. If the intent is to add it to the 1.3 milestone, please re-add them later.

@foxish foxish removed cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. cherrypick-candidate labels Sep 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apiserver lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. 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.