Skip to content

Commit

Permalink
fixed ConsumerGroup flooding logs with client/metadata update req IBM…
Browse files Browse the repository at this point in the history
  • Loading branch information
antsbean committed Jan 16, 2020
1 parent 07c15a9 commit bd430e6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions consumer_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ func (c *consumerGroup) handleError(err error, topic string, partition int32) {
}

func (c *consumerGroup) loopCheckPartitionNumbers(topics []string, session *consumerGroupSession) {
pause := time.NewTicker(c.config.Consumer.Group.Heartbeat.Interval * 2)
pause := time.NewTicker(c.config.Metadata.RefreshFrequency)
defer session.cancel()
defer pause.Stop()
var oldTopicToPartitionNum map[string]int
Expand All @@ -469,10 +469,6 @@ func (c *consumerGroup) loopCheckPartitionNumbers(topics []string, session *cons
}

func (c *consumerGroup) topicToPartitionNumbers(topics []string) (map[string]int, error) {
if err := c.client.RefreshMetadata(topics...); err != nil {
Logger.Printf("Consumer Group refresh metadata failed %v", err)
return nil, err
}
topicToPartitionNum := make(map[string]int, len(topics))
for _, topic := range topics {
if partitionNum, err := c.client.Partitions(topic); err != nil {
Expand Down

0 comments on commit bd430e6

Please sign in to comment.