Skip to content

Commit

Permalink
Extra sleep when __consumer_offsets does not exist yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanbergen committed Apr 10, 2015
1 parent c3b50d6 commit 6857713
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,13 @@ func (client *client) getConsumerMetadata(consumerGroup string, retriesRemaining
case ErrConsumerCoordinatorNotAvailable:
Logger.Printf("client/coordinator Coordinator for consumer group %s is not available.\n", consumerGroup)

// This is quite shitty, but this scenario will only happen once per cluster, because the

This comment has been minimized.

Copy link
@eapache

eapache Apr 10, 2015

Contributor

let's avoid outright swearing in a public OSS repo :)

// __consumer_offsets only has to be created one time.
if err := client.RefreshMetadata("__consumer_offsets"); err == ErrUnknownTopicOrPartition {
Logger.Printf("client/coordinator The __consumer_offsets topic does not yet exist.\n", consumerGroup)
time.Sleep(2 * time.Second)
}

if retriesRemaining > 0 {
Logger.Printf("Retrying after %dms... (%d retries remaining)\n", client.conf.Metadata.Retry.Backoff/time.Millisecond, retriesRemaining)
time.Sleep(client.conf.Metadata.Retry.Backoff)
Expand Down

0 comments on commit 6857713

Please sign in to comment.