From ceae272ca820ed3a64ed71882434394f13baa8f0 Mon Sep 17 00:00:00 2001 From: Gorbunov Kirill Andreevich Date: Fri, 19 Apr 2024 13:16:23 +0300 Subject: [PATCH] #133 fix race. --- subscriber.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subscriber.go b/subscriber.go index 2026834..44560d7 100644 --- a/subscriber.go +++ b/subscriber.go @@ -186,7 +186,9 @@ func (s *subscriber) assigned(_ context.Context, c *kgo.Client, assigned map[str kopts: s.kopts, opts: s.opts, } + s.Lock() s.consumers[tp{topic, partition}] = pc + s.Unlock() go pc.consume() } }