Skip to content

Commit

Permalink
Log processor error in Kafka consumer (#4399)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
  • Loading branch information
pavolloffay and yurishkuro authored May 26, 2023
1 parent ced77da commit 5274400
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/ingester/app/consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ func (c *Consumer) handleMessages(pc sc.PartitionConsumer) {
defer msgProcessor.Close()
}

msgProcessor.Process(saramaMessageWrapper{msg})
err := msgProcessor.Process(saramaMessageWrapper{msg})
if err != nil {
c.logger.Error("Failed to process a Kafka message", zap.Error(err), zap.Int32("partition", msg.Partition), zap.Int64("offset", msg.Offset))
}

case <-deadlockDetector.closePartitionChannel():
c.logger.Info("Closing partition due to inactivity", zap.Int32("partition", pc.Partition()))
Expand Down

0 comments on commit 5274400

Please sign in to comment.