We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea2aa0e commit 730b30eCopy full SHA for 730b30e
pkg/internal/controller/controller.go
@@ -356,7 +356,8 @@ func (c *Controller[request]) startEventSourcesLocked(ctx context.Context) error
356
case err := <-sourceStartErrChan:
357
return err
358
case <-sourceStartCtx.Done():
359
- if didStartSyncingSource.Load() { // We are racing with WaitForSync, wait for it to let it tell us what happened
+ defer func() { <-sourceStartErrChan }() // Ensure that watch.Start has been called to avoid prematurely releasing lock before accessing c.Queue
360
+ if didStartSyncingSource.Load() { // We are racing with WaitForSync, wait for it to let it tell us what happened
361
return <-sourceStartErrChan
362
}
363
if ctx.Err() != nil { // Don't return an error if the root context got cancelled
0 commit comments