dferstay commented on a change in pull request #533:
URL: https://github.com/apache/pulsar-client-go/pull/533#discussion_r658280811



##########
File path: pulsar/consumer_partition.go
##########
@@ -1062,16 +1065,19 @@ func getPreviousMessage(mid trackingMessageID) 
trackingMessageID {
 }
 
 func (pc *partitionConsumer) Decompress(msgMeta *pb.MessageMetadata, payload 
internal.Buffer) (internal.Buffer, error) {
+       pc.providersMutex.Lock()

Review comment:
       @fishpenguin , @cckellogg ,
   I'm thinking an [RWMutex](https://golang.org/pkg/sync/#RWMutex) would 
generate less contention.  The majority of accesses require the read lock; the 
write lock is only required when initialising the provider.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to