Skip to content

Commit

Permalink
client: given both retries and errors, prefer retries
Browse files Browse the repository at this point in the history
Now that some errors (e.g. UnknownTopicOrParition) set *both* a retry flag and
an error, we should handle retries first. This is sort-of non-idiomatic in that
`updateMetadata` now returns a non-nil error with a "valid" result, but I think
that's OK.
  • Loading branch information
eapache committed Mar 20, 2015
1 parent 58fb767 commit 64a27f0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,13 +591,9 @@ func (client *client) updateMetadata(data *MetadataResponse) ([]string, error) {
client.cachedPartitionsResults[topic.Name] = partitionCache
}

if err != nil {
return nil, err
}

ret := make([]string, 0, len(toRetry))
for topic := range toRetry {
ret = append(ret, topic)
}
return ret, nil
return ret, err
}

0 comments on commit 64a27f0

Please sign in to comment.