Skip to content

Commit 010e8e1

Browse files
committed
txn: fix panic in GroupTransactSession.End
Introduced in a059901 in v1.3.0, if TxnOffsetCommit fails, resp will be nil and error will be non-nil.
1 parent f9cd625 commit 010e8e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/kgo/txn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,12 @@ func (s *GroupTransactSession) End(ctx context.Context, commit TransactionEndTry
271271
committed := make(chan struct{})
272272
g = s.cl.commitTransactionOffsets(context.Background(), postcommit,
273273
func(_ *kmsg.TxnOffsetCommitRequest, resp *kmsg.TxnOffsetCommitResponse, err error) {
274-
kip447 = resp.Version >= 3
275274
defer close(committed)
276275
if err != nil {
277276
commitErrs = append(commitErrs, err.Error())
278277
return
279278
}
279+
kip447 = resp.Version >= 3
280280

281281
for _, t := range resp.Topics {
282282
for _, p := range t.Partitions {

0 commit comments

Comments
 (0)