diff --git a/core/internal/storage/inmemory.go b/core/internal/storage/inmemory.go index 5f8fcd8c..d2dfd39e 100644 --- a/core/internal/storage/inmemory.go +++ b/core/internal/storage/inmemory.go @@ -642,6 +642,7 @@ func (module *InMemoryStorage) deleteTopic(request *protocol.StorageRequest, req return } + clusterMap.consumerLock.RLock() // Work backwards - remove the topic from consumer groups first for _, consumerMap := range clusterMap.consumer { consumerMap.lock.Lock() @@ -649,6 +650,7 @@ func (module *InMemoryStorage) deleteTopic(request *protocol.StorageRequest, req delete(consumerMap.topics, request.Topic) consumerMap.lock.Unlock() } + clusterMap.consumerLock.RUnlock() // Now remove the topic from the broker list clusterMap.brokerLock.Lock()