Skip to content

Commit 6f6325c

Browse files
committed
Remove synchronization code around c.Queue concurrent access.
1 parent 1ed6722 commit 6f6325c

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

pkg/internal/controller/controller.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,11 @@ func (c *Controller[request]) startEventSourcesAndQueueLocked(ctx context.Contex
333333
defer cancel()
334334

335335
sourceStartErrChan := make(chan error, 1) // Buffer chan to not leak goroutine if we time out
336-
hasAccessedQueueChan := make(chan struct{}) //
337336
go func() {
338337
defer close(sourceStartErrChan)
339338
log.Info("Starting EventSource")
340339

341340
q := c.Queue
342-
close(hasAccessedQueueChan)
343341
if err := watch.Start(ctx, q); err != nil {
344342
sourceStartErrChan <- err
345343
return
@@ -360,7 +358,6 @@ func (c *Controller[request]) startEventSourcesAndQueueLocked(ctx context.Contex
360358
case err := <-sourceStartErrChan:
361359
return err
362360
case <-sourceStartCtx.Done():
363-
defer func() { <-hasAccessedQueueChan }() // Ensure that watch.Start has been called to avoid prematurely releasing lock before accessing c.Queue
364361
if didStartSyncingSource.Load() { // We are racing with WaitForSync, wait for it to let it tell us what happened
365362
return <-sourceStartErrChan
366363
}

0 commit comments

Comments
 (0)