-
Notifications
You must be signed in to change notification settings - Fork 333
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
Improves start up performance with lb templates #4379
base: master
Are you sure you want to change the base?
Conversation
hit #4381 |
We were not waiting on for informers to fully shutdown for level-driven controllers. As a consequence, goroutines would still be running handling events while the next unit test case ran. In this case, a handler with no workqueue (like node_tracker) would attempt to read global config, while the next test case was modifying the global config, leading to a data race. Fixes: ovn-org#4381 Signed-off-by: Tim Rozet <[email protected]>
Rebasing on #4383 to see if that makes this unit test CI green |
Follow up from ovn-org#4270 During initial node sync, we were creating all of the lb templates over and over again in OVN. Service handler starts after, and will take care of adding missing LB templates while the node cache is already hot. There is no point in doing it during node info sync on start up. It is still required to do when nodes are added or removed post-start. Signed-off-by: Tim Rozet <[email protected]>
efcd6c4
to
f1f8ef1
Compare
// Stop stops the factory informers, and waits for their handlers to stop | ||
func (wf *WatchFactory) Stop() { | ||
klog.Info("Stopping watch factory") | ||
wf.iFactory.Shutdown() |
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.
note for others: for the shutdowns here, stop channels must be closed prior to calling shutdown, and that is accomplished before Stop()
func being called.
c.nodeIPv6Templates.AsTemplateMap(), | ||
} | ||
if err := svcCreateOrUpdateTemplateVar(c.nbClient, nodeIPTemplates); err != nil { | ||
klog.Errorf("Could not sync node IP templates") |
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.
include the error message in the log
if err := svcCreateOrUpdateTemplateVar(c.nbClient, nodeIPTemplates); err != nil { | ||
klog.Errorf("Could not sync node IP templates") | ||
return | ||
c.startupDoneLock.RLock() |
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.
note for others - this will not block for long. Another controller only locks to write to a bool startupDone
and unlocks immediately after.
klog.Errorf("Could not sync node IP templates") | ||
return | ||
c.startupDoneLock.RLock() | ||
defer c.startupDoneLock.RUnlock() |
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.
do we need to keep hold of the lock while processing svcCreateOrUpdateTemplateVar
below?
Follow up from #4270
During initial node sync, we were creating all of the lb templates over and over again in OVN. Service handler starts after, and will take care of adding missing LB templates while the node cache is already hot. There is no point in doing it during node info sync on start up.
It is still required to do when nodes are added or removed post-start.