diff --git a/pkg/schedule/schedulers/scheduler_controller.go b/pkg/schedule/schedulers/scheduler_controller.go index 4d72699b0feb..ba4ba922bc4b 100644 --- a/pkg/schedule/schedulers/scheduler_controller.go +++ b/pkg/schedule/schedulers/scheduler_controller.go @@ -67,6 +67,8 @@ func NewController(ctx context.Context, cluster sche.SchedulerCluster, storage e // Wait waits on all schedulers to exit. func (c *Controller) Wait() { + c.Lock() + defer c.Unlock() c.wg.Wait() }