Browse Source

Merge pull request #252 from Shopify/full-topic-leader-election

client: recognize full-topic leader election
Evan Huus 11 năm trước cách đây
mục cha
commit
e3da6a9811
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      client.go

+ 7 - 1
client.go

@@ -528,7 +528,13 @@ func (client *Client) update(data *MetadataResponse) ([]string, error) {
 
 
 	var err error
 	var err error
 	for _, topic := range data.Topics {
 	for _, topic := range data.Topics {
-		if topic.Err != NoError {
+		switch topic.Err {
+		case NoError:
+			break
+		case LeaderNotAvailable:
+			toRetry[topic.Name] = true
+			continue
+		default:
 			err = topic.Err
 			err = topic.Err
 			continue
 			continue
 		}
 		}