瀏覽代碼

Merge pull request #1286 from aksdb/fix-heartbeat-deadlock

fixed potential deadlock when a heartbeat request fails
Vlad Gorodetsky 7 年之前
父節點
當前提交
dca1ba6cd0
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      consumer_group.go

+ 6 - 0
consumer_group.go

@@ -657,6 +657,12 @@ func (s *consumerGroupSession) heartbeatLoop() {
 		resp, err := s.parent.heartbeatRequest(coordinator, s.memberID, s.generationID)
 		if err != nil {
 			_ = coordinator.Close()
+
+			if retries <= 0 {
+				s.parent.handleError(err, "", -1)
+				return
+			}
+
 			retries--
 			continue
 		}