Skip to content

Commit cd65d77

Browse files
committedFeb 7, 2024
kgo: fix bug
Previously, if CommitOffsetsSync was called during a rebalance, and the context being used is canceled while the rebalance was occurring, then the client would deadlock. Internally, committing is blocked if a rebalance is actively happening. There's some complex logic to have, effectively, a cancelable lock if the user wants to not wait for a rebalance to complete while trying to commit offsets. There was a bug, and since the fix is one line, it's easier to see than explain. Closes #668.
1 parent d40ac19 commit cd65d77

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎pkg/kgo/consumer_group.go

+1
Original file line numberDiff line numberDiff line change
@@ -2584,6 +2584,7 @@ func (g *groupConsumer) commitOffsetsSync(
25842584

25852585
if err := g.waitJoinSyncMu(ctx); err != nil {
25862586
onDone(g.cl, kmsg.NewPtrOffsetCommitRequest(), kmsg.NewPtrOffsetCommitResponse(), err)
2587+
close(done)
25872588
return
25882589
}
25892590
unblockCommits := func(cl *Client, req *kmsg.OffsetCommitRequest, resp *kmsg.OffsetCommitResponse, err error) {

0 commit comments

Comments
 (0)
Please sign in to comment.