You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/12/24 03:32:10 UTC

[GitHub] [rocketmq] xiaoyifang opened a new pull request, #5769: [ISSUE #5766] fix possible msg NPE

xiaoyifang opened a new pull request, #5769:
URL: https://github.com/apache/rocketmq/pull/5769

   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   fix #5766
   
   ## 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) 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.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #5769: [ISSUE #5766] fix possible msg NPE

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #5769:
URL: https://github.com/apache/rocketmq/pull/5769#discussion_r1057594259


##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java:
##########
@@ -102,6 +98,10 @@ public void cleanExpiredMsg(DefaultMQPushConsumer pushConsumer) {
                 log.error("getExpiredMsg exception", e);
             }
 
+            if (msg == null) {
+                break;

Review Comment:
   The rest of msgTreeMap's messages can't be processed after the loop terminates,
   
   Is it OK to skip processing message that are currently empty?



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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] xiaoyifang commented on a diff in pull request #5769: [ISSUE #5766] fix possible msg NPE

Posted by GitBox <gi...@apache.org>.
xiaoyifang commented on code in PR #5769:
URL: https://github.com/apache/rocketmq/pull/5769#discussion_r1058071140


##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java:
##########
@@ -102,6 +98,10 @@ public void cleanExpiredMsg(DefaultMQPushConsumer pushConsumer) {
                 log.error("getExpiredMsg exception", e);
             }
 
+            if (msg == null) {
+                break;

Review Comment:
   I think it should be ok.   
   
   in most cases , the rest of msgTreeMap should be empty or interrupted ,in these cases , break the loop is reasonable.
   
   if other cases ,the rest items can wait until the next clean 



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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] codecov-commenter commented on pull request #5769: [ISSUE #5766] fix possible msg NPE

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #5769:
URL: https://github.com/apache/rocketmq/pull/5769#issuecomment-1364454317

   # [Codecov](https://codecov.io/gh/apache/rocketmq/pull/5769?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#5769](https://codecov.io/gh/apache/rocketmq/pull/5769?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8fbe32b) into [develop](https://codecov.io/gh/apache/rocketmq/commit/646d04f42524636ad09364af2a67fa8ab8b6b8fa?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (646d04f) will **increase** coverage by `0.01%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #5769      +/-   ##
   =============================================
   + Coverage      42.45%   42.46%   +0.01%     
   + Complexity      8215     8213       -2     
   =============================================
     Files           1060     1060              
     Lines          73193    73194       +1     
     Branches        9598     9598              
   =============================================
   + Hits           31071    31082      +11     
   + Misses         38221    38203      -18     
   - Partials        3901     3909       +8     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/5769?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...he/rocketmq/client/impl/consumer/ProcessQueue.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9Qcm9jZXNzUXVldWUuamF2YQ==) | `62.11% <0.00%> (+0.16%)` | :arrow_up: |
   | [...controller/impl/DefaultBrokerHeartbeatManager.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL0RlZmF1bHRCcm9rZXJIZWFydGJlYXRNYW5hZ2VyLmphdmE=) | `82.27% <0.00%> (-3.80%)` | :arrow_down: |
   | [...ketmq/client/impl/consumer/PullMessageService.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9QdWxsTWVzc2FnZVNlcnZpY2UuamF2YQ==) | `49.23% <0.00%> (-3.08%)` | :arrow_down: |
   | [...e/rocketmq/store/ha/autoswitch/EpochFileCache.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2hhL2F1dG9zd2l0Y2gvRXBvY2hGaWxlQ2FjaGUuamF2YQ==) | `78.47% <0.00%> (-2.78%)` | :arrow_down: |
   | [...ache/rocketmq/store/AllocateMappedFileService.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL0FsbG9jYXRlTWFwcGVkRmlsZVNlcnZpY2UuamF2YQ==) | `39.28% <0.00%> (-2.39%)` | :arrow_down: |
   | [...mq/store/ha/autoswitch/AutoSwitchHAConnection.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2hhL2F1dG9zd2l0Y2gvQXV0b1N3aXRjaEhBQ29ubmVjdGlvbi5qYXZh) | `70.27% <0.00%> (-1.90%)` | :arrow_down: |
   | [...mq/client/impl/consumer/RebalanceLitePullImpl.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9SZWJhbGFuY2VMaXRlUHVsbEltcGwuamF2YQ==) | `69.86% <0.00%> (-1.37%)` | :arrow_down: |
   | [...cketmq/broker/schedule/ScheduleMessageService.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvc2NoZWR1bGUvU2NoZWR1bGVNZXNzYWdlU2VydmljZS5qYXZh) | `56.91% <0.00%> (-1.14%)` | :arrow_down: |
   | [.../org/apache/rocketmq/store/index/IndexService.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2luZGV4L0luZGV4U2VydmljZS5qYXZh) | `59.00% <0.00%> (-1.00%)` | :arrow_down: |
   | [...nt/impl/consumer/ConsumeMessageOrderlyService.java](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9Db25zdW1lTWVzc2FnZU9yZGVybHlTZXJ2aWNlLmphdmE=) | `49.47% <0.00%> (-0.71%)` | :arrow_down: |
   | ... and [20 more](https://codecov.io/gh/apache/rocketmq/pull/5769/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] xiaoyifang commented on a diff in pull request #5769: [ISSUE #5766] fix possible msg NPE

Posted by GitBox <gi...@apache.org>.
xiaoyifang commented on code in PR #5769:
URL: https://github.com/apache/rocketmq/pull/5769#discussion_r1058071140


##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java:
##########
@@ -102,6 +98,10 @@ public void cleanExpiredMsg(DefaultMQPushConsumer pushConsumer) {
                 log.error("getExpiredMsg exception", e);
             }
 
+            if (msg == null) {
+                break;

Review Comment:
   I think it should be ok.   
   
   in most cases , the rest of msgTreeMap should be empty or interrupted ,in these cases , break the loop is reasonable.
   
   in other cases ,the rest items can wait until the next clean 



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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] lizhimins merged pull request #5769: [ISSUE #5766] Fix possible NPE in client clean expired message

Posted by GitBox <gi...@apache.org>.
lizhimins merged PR #5769:
URL: https://github.com/apache/rocketmq/pull/5769


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

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org