Skip to content

Commit dca0be7

Browse files
authored
🐛 Fix race condition in channel source (#2286)
* Fix race condition in channel source * Also remove stop channel from struct Signed-off-by: Max Smythe <[email protected]> --------- Signed-off-by: Max Smythe <[email protected]>
1 parent 3171b66 commit dca0be7

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

pkg/source/source.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ type Channel struct {
7474
// Source is the source channel to fetch GenericEvents
7575
Source <-chan event.GenericEvent
7676

77-
// stop is to end ongoing goroutine, and close the channels
78-
stop <-chan struct{}
79-
8077
// dest is the destination channels of the added event handlers
8178
dest []chan event.GenericEvent
8279

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

106-
// set the stop channel to be the context.
107-
cs.stop = ctx.Done()
108-
109103
// use default value if DestBufferSize not specified
110104
if cs.DestBufferSize == 0 {
111105
cs.DestBufferSize = defaultBufferSize

0 commit comments

Comments
 (0)