소스 검색

Fix nil-pointer panic in consumer.

As was revealed during real-world use, if the broker we start with errors (and
returns a nil response) but we successfully find a new broker to talk to, we
have to start the loop again to get an actual response from the new broker.
Proceeding with the nil response just causes it to panic immediately.

Add the missing `continue` statement.
Evan Huus 12 년 전
부모
커밋
6b3b02e129
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      consumer.go

+ 1 - 0
consumer.go

@@ -156,6 +156,7 @@ func (c *Consumer) fetchMessages() {
 					return
 				}
 			}
+			continue
 		}
 
 		block := response.GetBlock(c.topic, c.partition)