You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/26 21:49:21 UTC

[GitHub] [pulsar-client-go] dferstay commented on a change in pull request #684: Use critical section for batch counters in producer default_router

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



##########
File path: pulsar/default_router.go
##########
@@ -30,6 +31,7 @@ type defaultRouter struct {
 	lastChangeTimestamp int64
 	msgCounter          uint32
 	cumulativeBatchSize uint32
+	sync.RWMutex

Review comment:
       I see that we only ever acquire write access; can this be a regular `sync.Mutex`

##########
File path: pulsar/default_router.go
##########
@@ -30,6 +31,7 @@ type defaultRouter struct {
 	lastChangeTimestamp int64
 	msgCounter          uint32
 	cumulativeBatchSize uint32
+	sync.RWMutex

Review comment:
       I see that we only ever acquire write access; can this be a regular `sync.Mutex`?




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

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