Skip to content

Commit 80a16e4

Browse files
Merge pull request #2764 from ncdc/fix-quota-gc-backlog
🐛 Prevent gc/quota workqueue backlogs
2 parents ddfd855 + c5a69a8 commit 80a16e4

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

pkg/reconciler/garbagecollector/garbagecollector_controller.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,13 @@ func (c *Controller) startGarbageCollectorForLogicalCluster(ctx context.Context,
290290
}
291291
}()
292292

293-
// Make sure the GC monitors are synced at least once
294-
garbageCollector.ResyncMonitors(ctx, c.dynamicDiscoverySharedInformerFactory)
293+
// Do this in a goroutine to avoid holding up a worker in the event ResyncMonitors stalls for whatever reason
294+
go func() {
295+
// Make sure the GC monitors are synced at least once
296+
garbageCollector.ResyncMonitors(ctx, c.dynamicDiscoverySharedInformerFactory)
295297

296-
go garbageCollector.Run(ctx, c.workersPerLogicalCluster)
298+
go garbageCollector.Run(ctx, c.workersPerLogicalCluster)
299+
}()
297300

298301
return nil
299302
}

pkg/reconciler/kubequota/kubequota_controller.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,13 @@ func (c *Controller) startQuotaForLogicalCluster(ctx context.Context, clusterNam
309309
}
310310
}()
311311

312-
// Make sure the monitors are synced at least once
313-
resourceQuotaController.UpdateMonitors(ctx, c.dynamicDiscoverySharedInformerFactory.ServerPreferredResources)
312+
// Do this in a goroutine to avoid holding up a worker in the event UpdateMonitors stalls for whatever reason
313+
go func() {
314+
// Make sure the monitors are synced at least once
315+
resourceQuotaController.UpdateMonitors(ctx, c.dynamicDiscoverySharedInformerFactory.ServerPreferredResources)
314316

315-
go resourceQuotaController.Run(ctx, c.workersPerLogicalCluster)
317+
go resourceQuotaController.Run(ctx, c.workersPerLogicalCluster)
318+
}()
316319

317320
return nil
318321
}

0 commit comments

Comments
 (0)