You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by we...@apache.org on 2020/01/21 10:34:34 UTC

[rocketmq-client-go] branch native updated: fix(core): unalign field panic when atomic operation (#397)

This is an automated email from the ASF dual-hosted git repository.

wenfeng pushed a commit to branch native
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git


The following commit(s) were added to refs/heads/native by this push:
     new 8937360  fix(core): unalign field panic when atomic operation (#397)
8937360 is described below

commit 893736076e4f26cf1b595bad8f8c216a7111e6c8
Author: xujianhai666 <52...@users.noreply.github.com>
AuthorDate: Tue Jan 21 18:34:24 2020 +0800

    fix(core): unalign field panic when atomic operation (#397)
    
    - move int64 to struct top
    
    Closes #396
---
 consumer/process_queue.go | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/consumer/process_queue.go b/consumer/process_queue.go
index 595cebb..aab3522 100644
--- a/consumer/process_queue.go
+++ b/consumer/process_queue.go
@@ -40,21 +40,21 @@ const (
 )
 
 type processQueue struct {
-	msgCache                   *treemap.Map
-	mutex                      sync.RWMutex
 	cachedMsgCount             int64
 	cachedMsgSize              int64
-	consumeLock                sync.Mutex
-	consumingMsgOrderlyTreeMap *treemap.Map
 	tryUnlockTimes             int64
 	queueOffsetMax             int64
+	msgAccCnt                  int64
+	msgCache                   *treemap.Map
+	mutex                      sync.RWMutex
+	consumeLock                sync.Mutex
+	consumingMsgOrderlyTreeMap *treemap.Map
 	dropped                    *uatomic.Bool
 	lastPullTime               time.Time
 	lastConsumeTime            atomic.Value
 	locked                     *uatomic.Bool
 	lastLockTime               atomic.Value
 	consuming                  bool
-	msgAccCnt                  int64
 	lockConsume                sync.Mutex
 	msgCh                      chan []*primitive.MessageExt
 	order                      bool