-
Notifications
You must be signed in to change notification settings - Fork 107
NotifierKafka: fix case when partition is empty (avoid hitting timeout) #1352
Conversation
734d02b
to
252c083
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this still failing qa post build?
mdata/notifierKafka/notifierKafka.go
Outdated
@@ -128,6 +128,10 @@ func (c *NotifierKafka) start() { | |||
} | |||
} | |||
|
|||
if startOffset < 0 { | |||
log.Infof("kafka-cluster: empty partition, nothing to consume") | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we do that, we're not going to consume it if data gets pushed into this partition in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ignore my complete dumb-ness. I'll just fix the lastReadOffset
in consumePartition
like I originally said.
252c083
to
6354efc
Compare
6354efc
to
16eaf01
Compare
lastReadOffset := startOffset - 1 | ||
var lastReadOffset int64 | ||
if startOffset < 0 { | ||
log.Infof("kafka-cluster: empty partition") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably mention which partition..
No description provided.