-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Bug 1508061: Fix panic during openshift controller options initialization #17127
Bug 1508061: Fix panic during openshift controller options initialization #17127
Conversation
a29cfa5
to
dfbd95f
Compare
pkg/cmd/server/start/start_master.go
Outdated
// Wait for the runEmbeddedKubeControllerManager to mutate the | ||
// ControllerArguments to prevent getOpenshiftControllerOptions from | ||
// panicking because of concurrent read/write access. | ||
<-controllerArgumentsInitialized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this smells. Do the openshift controller really have to see the mutated flags? Or was this only an accident?
Alternative without chan: mfojtik@4ce220b |
dfbd95f
to
3b3a5d6
Compare
@sttts updated. |
I pretty much prefer the deep-copy variant over the channel and the |
Waiting for tests.... |
/retest |
3b3a5d6
to
36e4f29
Compare
for _, item := range v { | ||
newVal = append(newVal, item) | ||
} | ||
cmdLineArgs[k] = newVal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: append([]string{}, v...)
36e4f29
to
8c7ba88
Compare
/lgtm |
/lgtm |
func newKubeControllerManager(kubeconfigFile, saPrivateKeyFile, saRootCAFile, podEvictionTimeout, recyclerImage string, dynamicProvisioningEnabled bool, cmdLineArgs map[string][]string) (*controlleroptions.CMServer, []func(), error) { | ||
if cmdLineArgs == nil { | ||
cmdLineArgs = map[string][]string{} | ||
func newKubeControllerManager(kubeconfigFile, saPrivateKeyFile, saRootCAFile, podEvictionTimeout, recyclerImage string, dynamicProvisioningEnabled bool, controllerArgs map[string][]string) (*controlleroptions.CMServer, []func(), error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issue exists in newScheduler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liggitt i don't think getOpenshiftControllerOptions
iterate over m.config.KubernetesMasterConfig.SchedulerArguments so we are probably safe there but yeah, we should deep copy to be sure there as well. I will update this PR
8c7ba88
to
9b2f23d
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, liggitt, mfojtik, simo5 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest |
2 similar comments
/retest |
/retest |
Automatic merge from submit-queue. |
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1508061
Basically
newKubeControllerManager
mutates the cmdLineArgs in parallel togetOpenshiftControllerOptions
which is trying to read it.@deads2k @sttts PTAL, i consider this 3.7 blocker.