Skip to content

Commit

Permalink
Fix race on error channel in consumer factory (knative-extensions#364)
Browse files Browse the repository at this point in the history
* Fix knative-extensions#342

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Commit mistake

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
  • Loading branch information
slinkydeveloper authored Feb 4, 2021
1 parent 51ff52a commit b7ca3d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/common/consumer/consumer_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func (c *customConsumerGroup) Errors() <-chan error {

func (c *customConsumerGroup) Close() error {
c.cancel()
close(c.handlerErrorChannel)
return c.ConsumerGroup.Close()
}

Expand All @@ -64,6 +63,7 @@ func (c kafkaConsumerGroupFactoryImpl) StartConsumerGroup(groupID string, topics
ctx, cancel := context.WithCancel(context.Background())

go func() {
defer close(errorCh)
for {
consumerHandler := NewConsumerHandler(logger, handler, errorCh)

Expand Down

0 comments on commit b7ca3d0

Please sign in to comment.