Skip to content

Commit

Permalink
fix: added Errors() read from kafkaSensor's producer (argoproj#2959)
Browse files Browse the repository at this point in the history
Signed-off-by: AmitMendl <[email protected]>
  • Loading branch information
MenD32 authored and ryancurrah committed Jan 20, 2024
1 parent f92e58d commit f03fee0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions eventbus/kafka/sensor/kafka_sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ func (s *KafkaSensor) Initialize() error {
return err
}

// producer is at risk of deadlocking if Errors channel isn't read.
go func() {
for err := range producer.Errors() {
s.Logger.Errorf("Kafka producer error", zap.Error(err))
}
}()

s.client = client
s.consumer = consumer
s.kafkaHandler = &KafkaHandler{
Expand Down

0 comments on commit f03fee0

Please sign in to comment.