Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

NotifierKafka: avoid timeout case when there are no persist messages and using OffsetOldest or offsetDuration #1328

Merged
merged 1 commit into from
May 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mdata/notifierKafka/notifierKafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func (c *NotifierKafka) start() {
if err != nil {
log.Fatalf("kafka-cluster: failed to get offset %d: %s", offsetTime, err)
}
if startOffset < 0 {
// happens when OffsetOldest or an offsetDuration was used and there is no message in the partition
startOffset = 0
}
processBacklog.Add(1)
go c.consumePartition(topic, partition, startOffset, processBacklog)
}
Expand Down