Преглед изворни кода

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)
 		resp, err := s.parent.heartbeatRequest(coordinator, s.memberID, s.generationID)
 		if err != nil {
 		if err != nil {
 			_ = coordinator.Close()
 			_ = coordinator.Close()
+
+			if retries <= 0 {
+				s.parent.handleError(err, "", -1)
+				return
+			}
+
 			retries--
 			retries--
 			continue
 			continue
 		}
 		}