You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/11/18 02:26:01 UTC

[GitHub] [rocketmq-client-go] wenfengwang commented on a change in pull request #300: fix: offset store read missing fallthrough for _ReadMemoryThenStore

wenfengwang commented on a change in pull request #300: fix: offset store read missing fallthrough for _ReadMemoryThenStore
URL: https://github.com/apache/rocketmq-client-go/pull/300#discussion_r347181572
 
 

 ##########
 File path: consumer/offset_store.go
 ##########
 @@ -277,14 +278,16 @@ func (r *remoteBrokerOffsetStore) read(mq *primitive.MessageQueue, t readType) i
 	r.mutex.RLock()
 	switch t {
 	case _ReadFromMemory, _ReadMemoryThenStore:
-		defer r.mutex.RUnlock()
 		off, exist := r.OffsetTable[*mq]
 		if exist {
+			r.mutex.RUnlock()
 
 Review comment:
   could you replace all `RUnlock` with `defer`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services