Skip to content

Commit

Permalink
Merge pull request #7279 from damikag/refactor-mig-fetch-3
Browse files Browse the repository at this point in the history
Parallelly fetch mig instances in differet zones when  is enabled
  • Loading branch information
k8s-ci-robot authored Sep 13, 2024
2 parents d22b678 + 3001b6e commit 6826dc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cluster-autoscaler/cloudprovider/gce/mig_info_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ func (c *cachingMigInfoProvider) listInstancesInAllZonesWithMigs() ([]GceInstanc
zoneInstances := make([][]GceInstance, len(zones))
defer metrics.UpdateDurationFromStart(metrics.BulkListAllGceInstances, time.Now())

workqueue.ParallelizeUntil(context.Background(), c.concurrentGceRefreshes, len(zones), func(piece int) {
workqueue.ParallelizeUntil(context.Background(), len(zones), len(zones), func(piece int) {
zoneInstances[piece], errors[piece] = c.gceClient.FetchAllInstances(c.projectId, zones[piece], "")
}, workqueue.WithChunkSize(c.concurrentGceRefreshes))
})

for _, instances := range zoneInstances {
allInstances = append(allInstances, instances...)
Expand Down

0 comments on commit 6826dc5

Please sign in to comment.