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 2018/03/28 15:33:40 UTC

[GitHub] aCoder2013 opened a new issue #260: There is a concurrent issue in StoreStatsService

aCoder2013 opened a new issue #260: There is a concurrent issue in StoreStatsService
URL: https://github.com/apache/rocketmq/issues/260
 
 
   The issue tracker is **ONLY** used for bug report and feature request. Keep in mind, please check whether there is an existing same report before your raise a new one.
   
   Alternately (especially if your communication is not a bug report), you can send mail to our [mailing lists](http://rocketmq.apache.org/about/contact/). We welcome any friendly suggestions, bug fixes, collaboration and other improvements.
   
   Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as the following:
   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   - What did you do (The steps to reproduce)?
   `StoreStatsService#getSinglePutMessageTopicSizeTotal` and `StoreStatsService#getSinglePutMessageTopicTimesTotal` are not thread safe ,normally this  won't happen ,because the cost of creating a AtomicLong and put into a map can be ignored ,but shit happens ,i think this should be fixed
   - What did you expect to see?
   `StoreStatsService#getSinglePutMessageTopicSizeTotal` and `StoreStatsService#getSinglePutMessageTopicTimesTotal` will always return the instance 
   - What did you see instead?
   
   2. Please tell us about your environment:
   Max OSX
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
   ```java
       public AtomicLong getSinglePutMessageTopicTimesTotal(String topic) {
           AtomicLong rs = putMessageTopicTimesTotal.get(topic);
           if (null == rs) {
               rs = new AtomicLong(0);
               putMessageTopicTimesTotal.put(topic, rs);
           }
           return rs;
       }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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