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 2020/05/15 14:24:43 UTC

[GitHub] [rocketmq] lebron374 opened a new pull request #2000: Thread safe fix

lebron374 opened a new pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000


   ## What is the purpose of the change
   
   IndexService#getAndCreateLastIndexFile threadsafe issue
   
   ## Brief changelog
   
   XX
   
   ## Verifying this change
   
   XXXX
   
   Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues/1986) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
   - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test`  to make sure integration-test pass.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


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



[GitHub] [rocketmq] lebron374 commented on a change in pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
lebron374 commented on a change in pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#discussion_r428389586



##########
File path: store/src/main/java/org/apache/rocketmq/store/index/IndexService.java
##########
@@ -313,14 +313,24 @@ public IndexFile getAndCreateLastIndexFile() {
 
         if (indexFile == null) {
             try {
-                String fileName =
-                    this.storePath + File.separator
-                        + UtilAll.timeMillisToHumanString(System.currentTimeMillis());
-                indexFile =
-                    new IndexFile(fileName, this.hashSlotNum, this.indexNum, lastUpdateEndPhyOffset,
-                        lastUpdateIndexTimestamp);
                 this.readWriteLock.writeLock().lock();
-                this.indexFileList.add(indexFile);
+
+                IndexFile tmp = null;
+                if (!this.indexFileList.isEmpty()) {
+                    tmp = this.indexFileList.get(this.indexFileList.size() - 1);
+                }
+
+                if (null == tmp || tmp.isWriteFull()) {

Review comment:
       tmp may null you' ll find




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



[GitHub] [rocketmq] lebron374 commented on a change in pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
lebron374 commented on a change in pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#discussion_r428397224



##########
File path: store/src/main/java/org/apache/rocketmq/store/index/IndexService.java
##########
@@ -313,14 +313,24 @@ public IndexFile getAndCreateLastIndexFile() {
 
         if (indexFile == null) {
             try {
-                String fileName =
-                    this.storePath + File.separator
-                        + UtilAll.timeMillisToHumanString(System.currentTimeMillis());
-                indexFile =
-                    new IndexFile(fileName, this.hashSlotNum, this.indexNum, lastUpdateEndPhyOffset,
-                        lastUpdateIndexTimestamp);
                 this.readWriteLock.writeLock().lock();
-                this.indexFileList.add(indexFile);
+
+                IndexFile tmp = null;
+                if (!this.indexFileList.isEmpty()) {
+                    tmp = this.indexFileList.get(this.indexFileList.size() - 1);
+                }
+
+                if (null == tmp || tmp.isWriteFull()) {

Review comment:
       o,maybe my mistake, i don't have the idea to change whole code,i just try to fix the bug without change the conditions
   
   




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



[GitHub] [rocketmq] imaffe commented on a change in pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
imaffe commented on a change in pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#discussion_r428218895



##########
File path: store/src/main/java/org/apache/rocketmq/store/index/IndexService.java
##########
@@ -313,14 +313,24 @@ public IndexFile getAndCreateLastIndexFile() {
 
         if (indexFile == null) {
             try {
-                String fileName =
-                    this.storePath + File.separator
-                        + UtilAll.timeMillisToHumanString(System.currentTimeMillis());
-                indexFile =
-                    new IndexFile(fileName, this.hashSlotNum, this.indexNum, lastUpdateEndPhyOffset,
-                        lastUpdateIndexTimestamp);
                 this.readWriteLock.writeLock().lock();
-                this.indexFileList.add(indexFile);
+
+                IndexFile tmp = null;
+                if (!this.indexFileList.isEmpty()) {
+                    tmp = this.indexFileList.get(this.indexFileList.size() - 1);
+                }
+
+                if (null == tmp || tmp.isWriteFull()) {

Review comment:
       should we update `prevIndexFile` when `tmp.isWriteFull()` is true ?




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



[GitHub] [rocketmq] coveralls edited a comment on pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#issuecomment-629276885


   
   [![Coverage Status](https://coveralls.io/builds/30828036/badge)](https://coveralls.io/builds/30828036)
   
   Coverage decreased (-0.1%) to 50.836% when pulling **ced36c64c9b864aafc3c19b3c256e0610db494ba on lebron374:thread_safe_fix** into **7f105361022f3a0de8c1d6feda04d5eba3dba6bb on apache:develop**.
   


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



[GitHub] [rocketmq] coveralls edited a comment on pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#issuecomment-629276885


   
   [![Coverage Status](https://coveralls.io/builds/30829173/badge)](https://coveralls.io/builds/30829173)
   
   Coverage increased (+0.4%) to 51.341% when pulling **0870d0cdeda9e5e1cef779a278627d80639a1fe7 on lebron374:thread_safe_fix** into **7f105361022f3a0de8c1d6feda04d5eba3dba6bb on apache:develop**.
   


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



[GitHub] [rocketmq] lebron374 commented on pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
lebron374 commented on pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#issuecomment-633635790


   i create new pr https://github.com/apache/rocketmq/pull/2041


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



[GitHub] [rocketmq] codecov-io edited a comment on pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#issuecomment-629276929


   # [Codecov](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=h1) Report
   > Merging [#2000](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=desc) into [develop](https://codecov.io/gh/apache/rocketmq/commit/7f105361022f3a0de8c1d6feda04d5eba3dba6bb&el=desc) will **increase** coverage by `0.36%`.
   > The diff coverage is `52.17%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/rocketmq/pull/2000/graphs/tree.svg?width=650&height=150&src=pr&token=4w0sxP1wZv)](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=tree)
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #2000      +/-   ##
   =============================================
   + Coverage      45.05%   45.41%   +0.36%     
   - Complexity      4192     4214      +22     
   =============================================
     Files            545      545              
     Lines          35732    35746      +14     
     Branches        4744     4746       +2     
   =============================================
   + Hits           16100    16235     +135     
   + Misses         17588    17456     -132     
   - Partials        2044     2055      +11     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [.../rocketmq/broker/filter/ConsumerFilterManager.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvZmlsdGVyL0NvbnN1bWVyRmlsdGVyTWFuYWdlci5qYXZh) | `72.19% <ø> (ø)` | `33.00 <0.00> (ø)` | |
   | [...org/apache/rocketmq/common/message/MessageExt.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vbWVzc2FnZS9NZXNzYWdlRXh0LmphdmE=) | `64.44% <0.00%> (-3.80%)` | `34.00 <0.00> (ø)` | |
   | [...a/org/apache/rocketmq/store/StoreStatsService.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL1N0b3JlU3RhdHNTZXJ2aWNlLmphdmE=) | `67.09% <83.33%> (+38.24%)` | `43.00 <0.00> (+18.00)` | |
   | [.../org/apache/rocketmq/store/index/IndexService.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2luZGV4L0luZGV4U2VydmljZS5qYXZh) | `57.36% <87.50%> (+0.37%)` | `31.00 <0.00> (+2.00)` | |
   | [...tmq/logappender/log4j2/RocketmqLog4j2Appender.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-bG9nYXBwZW5kZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL2xvZ2FwcGVuZGVyL2xvZzRqMi9Sb2NrZXRtcUxvZzRqMkFwcGVuZGVyLmphdmE=) | `35.00% <0.00%> (-10.00%)` | `3.00% <0.00%> (-1.00%)` | |
   | [...a/org/apache/rocketmq/filter/util/BloomFilter.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-ZmlsdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9maWx0ZXIvdXRpbC9CbG9vbUZpbHRlci5qYXZh) | `59.13% <0.00%> (-2.16%)` | `25.00% <0.00%> (-1.00%)` | |
   | [...ava/org/apache/rocketmq/filter/util/BitsArray.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-ZmlsdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9maWx0ZXIvdXRpbC9CaXRzQXJyYXkuamF2YQ==) | `58.11% <0.00%> (-1.71%)` | `29.00% <0.00%> (-1.00%)` | |
   | [...ain/java/org/apache/rocketmq/store/MappedFile.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL01hcHBlZEZpbGUuamF2YQ==) | `50.18% <0.00%> (-0.37%)` | `50.00% <0.00%> (-1.00%)` | |
   | [.../apache/rocketmq/logging/inner/LoggingBuilder.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-bG9nZ2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbG9nZ2luZy9pbm5lci9Mb2dnaW5nQnVpbGRlci5qYXZh) | `63.60% <0.00%> (-0.32%)` | `3.00% <0.00%> (ø%)` | |
   | [...rocketmq/client/impl/factory/MQClientInstance.java](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9mYWN0b3J5L01RQ2xpZW50SW5zdGFuY2UuamF2YQ==) | `46.17% <0.00%> (-0.15%)` | `80.00% <0.00%> (-1.00%)` | |
   | ... and [8 more](https://codecov.io/gh/apache/rocketmq/pull/2000/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=footer). Last update [7f10536...0870d0c](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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



[GitHub] [rocketmq] vongosling closed pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
vongosling closed pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000


   


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



[GitHub] [rocketmq] imaffe commented on a change in pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
imaffe commented on a change in pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#discussion_r428220778



##########
File path: store/src/test/java/org/apache/rocketmq/store/StoreStatsServiceTest.java
##########
@@ -22,9 +22,18 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 import org.junit.Test;
+import static org.junit.Assert.*;
 
 public class StoreStatsServiceTest {
 
+    @Test
+    public void StoreStatsServiceStringFromat() throws Exception {
+
+        StoreStatsService storeStatsService = new StoreStatsService();
+        new Thread(storeStatsService).start();

Review comment:
        wondering if it is necessary to start a new thread ~ will toString() fail if this service is not started ?




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



[GitHub] [rocketmq] coveralls edited a comment on pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#issuecomment-629276885


   
   [![Coverage Status](https://coveralls.io/builds/30828695/badge)](https://coveralls.io/builds/30828695)
   
   Coverage increased (+0.2%) to 51.2% when pulling **c2d81be298eeac605e06da0e1544fdb0bd60293f on lebron374:thread_safe_fix** into **7f105361022f3a0de8c1d6feda04d5eba3dba6bb on apache:develop**.
   


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



[GitHub] [rocketmq] codecov-io edited a comment on pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#issuecomment-629276929


   # [Codecov](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=h1) Report
   > :exclamation: No coverage uploaded for pull request base (`develop@a5d72be`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/rocketmq/pull/2000/graphs/tree.svg?width=650&height=150&src=pr&token=4w0sxP1wZv)](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##             develop    #2000   +/-   ##
   ==========================================
     Coverage           ?   45.10%           
     Complexity         ?     4198           
   ==========================================
     Files              ?      545           
     Lines              ?    35741           
     Branches           ?     4746           
   ==========================================
     Hits               ?    16120           
     Misses             ?    17573           
     Partials           ?     2048           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=footer). Last update [a5d72be...ced36c6](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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



[GitHub] [rocketmq] imaffe commented on a change in pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
imaffe commented on a change in pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#discussion_r428394319



##########
File path: store/src/main/java/org/apache/rocketmq/store/index/IndexService.java
##########
@@ -313,14 +313,24 @@ public IndexFile getAndCreateLastIndexFile() {
 
         if (indexFile == null) {
             try {
-                String fileName =
-                    this.storePath + File.separator
-                        + UtilAll.timeMillisToHumanString(System.currentTimeMillis());
-                indexFile =
-                    new IndexFile(fileName, this.hashSlotNum, this.indexNum, lastUpdateEndPhyOffset,
-                        lastUpdateIndexTimestamp);
                 this.readWriteLock.writeLock().lock();
-                this.indexFileList.add(indexFile);
+
+                IndexFile tmp = null;
+                if (!this.indexFileList.isEmpty()) {
+                    tmp = this.indexFileList.get(this.indexFileList.size() - 1);
+                }
+
+                if (null == tmp || tmp.isWriteFull()) {

Review comment:
       yeah that's why we might want to separate these two conditions. If `tmp` is not null and isWriteFull, then it is likely that  another thread created this `tmp` index file, which is different from the previous `prevIndexFile`. Probably I'm wrong LOL
   




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



[GitHub] [rocketmq] codecov-io commented on pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#issuecomment-629276929


   # [Codecov](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=h1) Report
   > :exclamation: No coverage uploaded for pull request base (`develop@a5d72be`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/rocketmq/pull/2000/graphs/tree.svg?width=650&height=150&src=pr&token=4w0sxP1wZv)](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##             develop    #2000   +/-   ##
   ==========================================
     Coverage           ?   45.11%           
     Complexity         ?     4200           
   ==========================================
     Files              ?      545           
     Lines              ?    35741           
     Branches           ?     4746           
   ==========================================
     Hits               ?    16126           
     Misses             ?    17564           
     Partials           ?     2051           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=footer). Last update [a5d72be...4c29d6b](https://codecov.io/gh/apache/rocketmq/pull/2000?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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



[GitHub] [rocketmq] lebron374 commented on a change in pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
lebron374 commented on a change in pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#discussion_r428389872



##########
File path: store/src/test/java/org/apache/rocketmq/store/StoreStatsServiceTest.java
##########
@@ -22,9 +22,18 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 import org.junit.Test;
+import static org.junit.Assert.*;
 
 public class StoreStatsServiceTest {
 
+    @Test
+    public void StoreStatsServiceStringFromat() throws Exception {
+
+        StoreStatsService storeStatsService = new StoreStatsService();
+        new Thread(storeStatsService).start();

Review comment:
       if do not start a new thread,may collect nothing




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



[GitHub] [rocketmq] coveralls commented on pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#issuecomment-629276885


   
   [![Coverage Status](https://coveralls.io/builds/30816117/badge)](https://coveralls.io/builds/30816117)
   
   Coverage decreased (-0.1%) to 50.834% when pulling **4c29d6b05e7e4dfc29151c4cbf33a276105fbda3 on lebron374:thread_safe_fix** into **7f105361022f3a0de8c1d6feda04d5eba3dba6bb on apache:develop**.
   


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



[GitHub] [rocketmq] coveralls edited a comment on pull request #2000: Thread safe fix

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #2000:
URL: https://github.com/apache/rocketmq/pull/2000#issuecomment-629276885


   
   [![Coverage Status](https://coveralls.io/builds/30826177/badge)](https://coveralls.io/builds/30826177)
   
   Coverage decreased (-0.01%) to 50.942% when pulling **c436ed309096df9f19442e51ee35ccb6888b9634 on lebron374:thread_safe_fix** into **7f105361022f3a0de8c1d6feda04d5eba3dba6bb on apache:develop**.
   


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