From 6fa49e6c8d10db1978396faf245ef31ccf84439a Mon Sep 17 00:00:00 2001 From: Max Smythe Date: Fri, 21 Apr 2023 20:04:20 -0700 Subject: [PATCH 1/2] Fix race condition in channel source --- pkg/source/source.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/source/source.go b/pkg/source/source.go index 17c4ec015c..e397f20f48 100644 --- a/pkg/source/source.go +++ b/pkg/source/source.go @@ -103,9 +103,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 From 5ad39db0f55f07313d6597e4694b3874c179f423 Mon Sep 17 00:00:00 2001 From: Max Smythe Date: Wed, 26 Apr 2023 10:42:35 -0700 Subject: [PATCH 2/2] Also remove stop channel from struct Signed-off-by: Max Smythe --- pkg/source/source.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/source/source.go b/pkg/source/source.go index e397f20f48..099c8d68fa 100644 --- a/pkg/source/source.go +++ b/pkg/source/source.go @@ -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