Skip to content

Commit

Permalink
txn: fix panic in GroupTransactSession.End
Browse files Browse the repository at this point in the history
Introduced in a059901 in v1.3.0, if TxnOffsetCommit fails, resp will be
nil and error will be non-nil.
  • Loading branch information
twmb committed Feb 28, 2022
1 parent f9cd625 commit 010e8e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kgo/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ func (s *GroupTransactSession) End(ctx context.Context, commit TransactionEndTry
committed := make(chan struct{})
g = s.cl.commitTransactionOffsets(context.Background(), postcommit,
func(_ *kmsg.TxnOffsetCommitRequest, resp *kmsg.TxnOffsetCommitResponse, err error) {
kip447 = resp.Version >= 3
defer close(committed)
if err != nil {
commitErrs = append(commitErrs, err.Error())
return
}
kip447 = resp.Version >= 3

for _, t := range resp.Topics {
for _, p := range t.Partitions {
Expand Down

0 comments on commit 010e8e1

Please sign in to comment.