Skip to content

Commit 082db89

Browse files
committed
add locking to g.uncommitted MarkCommitRecords
Signed-off-by: Vasiliy Tolstov <[email protected]>
1 parent f2002b3 commit 082db89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/kgo/consumer_group.go

+4
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,10 @@ func (cl *Client) MarkCommitRecords(rs ...*Record) {
18201820
rs[i].Topic == rs[j].Topic && rs[i].Partition < rs[j].Partition
18211821
})
18221822

1823+
// protect g.uncommitted map
1824+
g.mu.Lock()
1825+
defer g.mu.Unlock()
1826+
18231827
if g.uncommitted == nil {
18241828
g.uncommitted = make(uncommitted)
18251829
}

0 commit comments

Comments
 (0)