-
Notifications
You must be signed in to change notification settings - Fork 40k
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
NodeController waits for informer sync before doing anything #34809
Conversation
Jenkins unit/integration failed for commit ef04b9a13fdd7910eb29f5a28164c03eaec8e184. Full PR test history. The magic incantation to run this job again is |
Jenkins Kubemark GCE e2e failed for commit ef04b9a13fdd7910eb29f5a28164c03eaec8e184. Full PR test history. The magic incantation to run this job again is |
Jenkins GKE smoke e2e failed for commit 01ed1d6dde209a51f1d4c7673c41f55c1954ec41. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE e2e failed for commit 01ed1d6dde209a51f1d4c7673c41f55c1954ec41. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GCE e2e failed for commit 01ed1d6dde209a51f1d4c7673c41f55c1954ec41. Full PR test history. The magic incantation to run this job again is |
Please add a release note |
/lgtm |
@@ -351,6 +358,10 @@ func NewNodeController( | |||
func (nc *NodeController) Run() { | |||
// Incorporate the results of node status pushed from kubelet to master. | |||
go wait.Until(func() { | |||
if !nc.nodeInformer.Informer().HasSynced() || !nc.podInformer.Informer().HasSynced() || !nc.daemonSetInformer.Informer().HasSynced() { |
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.
How about something like
if !cache.WaitForCacheSync(stopCh, dsc.podStoreSynced, dsc.nodeStoreSynced) {
return
}
before starting any additional gofuncs?
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.
I forgot about this function. I agree it would be better.
@gmarek - can you please fix?
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.
That was my second though - I can do what you suggest, but then I'll need to do NC.Run() in a separate goroutine - which is semantically slightly bigger change than this one. As this is going to be cherry-picked I wanted to do safest one possible.
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.
Ok - so let's use WaitForCacheSync function instead the if`s you have
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.
Done.
fd6d728
to
b7d6fe3
Compare
@@ -351,6 +358,10 @@ func NewNodeController( | |||
func (nc *NodeController) Run() { | |||
// Incorporate the results of node status pushed from kubelet to master. | |||
go wait.Until(func() { | |||
if !cache.WaitForCacheSync(wait.NeverStop, nc.nodeInformer.Informer().HasSynced, nc.podInformer.Informer().HasSynced, nc.daemonSetInformer.Informer().HasSynced) { | |||
glog.V(2).Infof("NodeController is waiting for informers to sync...") |
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.
The log is outdated now - it should be something like "timed out waiting for informers to sync" or sth like that.
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.
Done.
@@ -351,6 +358,10 @@ func NewNodeController( | |||
func (nc *NodeController) Run() { | |||
// Incorporate the results of node status pushed from kubelet to master. | |||
go wait.Until(func() { | |||
if !cache.WaitForCacheSync(wait.NeverStop, nc.nodeInformer.Informer().HasSynced, nc.podInformer.Informer().HasSynced, nc.daemonSetInformer.Informer().HasSynced) { | |||
glog.V(2).Infof("NodeController timed out while waiting for informers to sync...") |
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.
Sorry - one more thing, these should be Errorf()
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.
Done.
/lgtm |
Jenkins verification failed for commit 7fa52e8a50d7219649caa77cddde1d1579001360. Full PR test history. The magic incantation to run this job again is |
gofmt. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
…-upstream-release-1.4 Automated cherry pick of #34809
Commit found in the "release-1.4" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
It's possible that this PR broke scalability tests - see discussion in: I'm trying the revert if this is the fault of this PR. |
…-of-#34809-upstream-release-1.4 Automated cherry pick of kubernetes#34809
cc @lavalamp @davidopp
This change is