Skip to content

Commit

Permalink
🐛 Fix race condition in channel source (#2286)
Browse files Browse the repository at this point in the history
* Fix race condition in channel source

* Also remove stop channel from struct

Signed-off-by: Max Smythe <smythe@google.com>

---------

Signed-off-by: Max Smythe <smythe@google.com>
  • Loading branch information
maxsmythe authored Apr 26, 2023
1 parent 3171b66 commit dca0be7
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/source/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ type Channel struct {
// Source is the source channel to fetch GenericEvents
Source <-chan event.GenericEvent

// stop is to end ongoing goroutine, and close the channels
stop <-chan struct{}

// dest is the destination channels of the added event handlers
dest []chan event.GenericEvent

Expand All @@ -103,9 +100,6 @@ func (cs *Channel) Start(
return fmt.Errorf("must specify Channel.Source")
}

// set the stop channel to be the context.
cs.stop = ctx.Done()

// use default value if DestBufferSize not specified
if cs.DestBufferSize == 0 {
cs.DestBufferSize = defaultBufferSize
Expand Down

0 comments on commit dca0be7

Please sign in to comment.