diff --git a/common/broker/grpcpubsub/client.go b/common/broker/grpcpubsub/client.go index abb98e5cb1..7ffa98843e 100644 --- a/common/broker/grpcpubsub/client.go +++ b/common/broker/grpcpubsub/client.go @@ -75,7 +75,9 @@ func (s *sharedSubscriber) Unsubscribe(subId string) { delete(s.out, subId) if len(s.out) == 0 && s.cancel != nil { s.cancel() + subLock.Lock() delete(subscribers, s.sharedKey) + subLock.Unlock() } }