wenqi.huang created ROCKETMQ-195:
------------------------------------

             Summary: concurrency bug when send data to slave.
                 Key: ROCKETMQ-195
                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-195
             Project: Apache RocketMQ
          Issue Type: Bug
          Components: rocketmq-store
    Affects Versions: 4.0.0-incubating
            Reporter: wenqi.huang
            Assignee: yukon
            Priority: Critical
         Attachments: bug.png

when I test it,I found this error:

2017-05-09 18:38:55 ERROR SendMessageThread_4 - do sync transfer other node, 
wait return, but failed, topic: BenchmarkTest tags: null client address: 
10.24.19.87
2017-05-09 18:38:55 WARN SendMessageThread_4 - putMessage not in lock eclipse 
time(ms)=1000, bodyLength=130
2017-05-09 18:38:55 WARN GroupTransferService - GroupTransferService service 
has exception.
java.lang.NullPointerException: null
        at 
org.apache.rocketmq.store.ha.HAService$GroupTransferService.doWaitTransfer(HAService.java:278)
 ~[rocketmq-store-4.1.0-incubating-SNAPSHOT.jar:4.1.0-incubating-SNAPSHOT]
        at 
org.apache.rocketmq.store.ha.HAService$GroupTransferService.run(HAService.java:301)
 ~[rocketmq-store-4.1.0-incubating-SNAPSHOT.jar:4.1.0-incubating-SNAPSHOT]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]

And I watch into this code and found that there is some concurrency bug,
then I try to fix it. pull request is:
https://github.com/apache/incubator-rocketmq/pull/102

as the code shows, the class pointer is volatile does not means ArrayList 
itself is threadsafe, so we need more job to ensure threadsafe.
(this pull request also fix some other bugs, the concurrency bug may cause 
NullPointerException or ConcurrentModificationException.)




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to