Skip to content

Commit

Permalink
Wait for initial cache to sync before starting autoscaling
Browse files Browse the repository at this point in the history
  • Loading branch information
domenicbozzuto committed Oct 23, 2024
1 parent 7d051cc commit f96bd6e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cluster-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,11 @@ func buildAutoscaler(debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter
// additional informers might have been registered in the factory during NewAutoscaler.
stop := make(chan struct{})
informerFactory.Start(stop)
klog.V(1).Info("Started shared informer factory, waiting for initial cache sync")

informerStartTime := time.Now()
informerFactory.WaitForCacheSync(stop)
klog.V(1).Infof("Shared informer factory finished initial sync, took %v", time.Since(informerStartTime))
return autoscaler, nil
}

Expand Down

0 comments on commit f96bd6e

Please sign in to comment.