Skip to content

Commit 85a680e

Browse files
committed
consuming: do not continually try to create fetch sessions
If we fail at creating a fetch session, we should not keep trying.
1 parent 2decd27 commit 85a680e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/kgo/source.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,11 +707,11 @@ func (s *source) fetch(consumerSession *consumerSession, doneFetch chan<- struct
707707
// advance past them).
708708
setOffsets = true
709709

710-
if resp.Version < 7 {
710+
if resp.Version < 7 || resp.SessionID <= 0 {
711711
// If the version is less than 7, we cannot use fetch sessions,
712712
// so we kill them on the first response.
713713
s.session.kill()
714-
} else if resp.SessionID > 0 {
714+
} else {
715715
s.session.bumpEpoch(resp.SessionID)
716716
}
717717

0 commit comments

Comments
 (0)