Sfoglia il codice sorgente

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

fixed potential deadlock when a heartbeat request fails
Vlad Gorodetsky 7 anni fa
parent
commit
dca1ba6cd0
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  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
 		}
 		}