Uploaded image for project: 'Apache RocketMQ'
  1. Apache RocketMQ
  2. ROCKETMQ-195

concurrency bug when send data to slave.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 4.0.0-incubating
    • None
    • rocketmq-store
    • None
    • Important

    Description

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

      Attachments

        1. bug.png
          413 kB
          wenqi.huang

        Activity

          People

            yukon Xinyu Zhou
            after_sss wenqi.huang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: