Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkg/runtime/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,19 @@ func (c *controller) runWorkers(ctx context.Context, workers int) {

for {
obj, shutdown := queue.Get()

if shutdown {
return
}

// Acquire from the semaphore
running <- struct{}{}

if queue.ShuttingDown() {
// If we acquired after the workers were shutdown,
// then drop this object and return instead of trying to add to the wait group, which will panic.
return
}

wait.Add(1)

go func() {
Expand Down