refactor tests && add test for tombstone && fix concurent read\write map
Some checks failed
test / test (pull_request) Failing after 17m56s
lint / lint (pull_request) Failing after 18m10s
coverage / build (pull_request) Failing after 18m16s

This commit is contained in:
Evstigneev Denis
2026-01-15 11:46:54 +03:00
parent f8d9e0584f
commit 3759fa2f7c
5 changed files with 273 additions and 11 deletions

View File

@@ -139,7 +139,11 @@ func (s *Subscriber) poll(ctx context.Context) {
fetches.EachPartition(func(p kgo.FetchTopicPartition) {
tps := tp{p.Topic, p.Partition}
s.consumers[tps].recs <- p
s.mu.Lock()
if c := s.consumers[tps]; c != nil {
c.recs <- p
}
s.mu.Unlock()
})
s.c.AllowRebalance()
}
@@ -157,6 +161,7 @@ func (s *Subscriber) killConsumers(ctx context.Context, lost map[string][]int32)
pc, ok := s.consumers[tps]
if ok {
delete(s.consumers, tps)
close(pc.quit)
}
s.mu.Unlock()
if !ok || pc == nil {
@@ -167,8 +172,6 @@ func (s *Subscriber) killConsumers(ctx context.Context, lost map[string][]int32)
s.kopts.Logger.Debug(ctx, fmt.Sprintf("[kgo] killing consumer topic %s partition %d", topic, partition))
}
close(pc.quit)
wg.Add(1)
go func(c *consumer, t string, p int32) {
defer wg.Done()