From 66a047e9e3017eddeb68f7346252b55bb1e9e563 Mon Sep 17 00:00:00 2001 From: fangchengjin Date: Wed, 1 Mar 2023 22:46:11 +0800 Subject: [PATCH] fix: continue in for loop when releasing an inexistent partition lock --- consumer/TalosConsumer.go | 2 +- consumer/TalosTopicsConsumer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/consumer/TalosConsumer.go b/consumer/TalosConsumer.go index 5261af2..8391f59 100644 --- a/consumer/TalosConsumer.go +++ b/consumer/TalosConsumer.go @@ -503,7 +503,7 @@ func (c *TalosConsumer) releasePartitionLock(toReleaseList []int32) { for _, partitionId := range toReleaseList { if _, ok := c.partitionFetcherMap[partitionId]; !ok { c.log.Errorf("partitionFetcher map not contains partition: %d", partitionId) - return + continue } c.partitionFetcherMap[partitionId].Unlock() } diff --git a/consumer/TalosTopicsConsumer.go b/consumer/TalosTopicsConsumer.go index 41df997..20b581d 100644 --- a/consumer/TalosTopicsConsumer.go +++ b/consumer/TalosTopicsConsumer.go @@ -518,7 +518,7 @@ func (c *TalosTopicsConsumer) releasePartitionLock(toReleaseList TopicPartitions for _, partitionId := range toReleaseList { if _, ok := c.partitionFetcherMap[partitionId]; !ok { c.log.Errorf("partitionFetcher map not contains partition: %d", partitionId) - return + continue } c.partitionFetcherMap[partitionId].Unlock() }