You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "HScarb (via GitHub)" <gi...@apache.org> on 2024/04/16 15:49:39 UTC

[PR] [ISSUE #8025] fix: fix topic route when topic deleted [rocketmq]

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

   <!-- Please make sure the target branch is right. In most case, the target branch should be `develop`. -->
   
   ### Which Issue(s) This PR Fixes
   
   <!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. -->
   
   Fixes #8025 
   
   ### Brief Description
   
   <!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
   
   1. make `getTopicRouteInfoFromNameServer` return null when the topic not exist and allow the topic not exist
   2. remove the topic from `topicRouteTable` when topic is null
   
   ### How Did You Test This Change?
   
   <!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. -->
   
   UT


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


Re: [PR] [ISSUE #8025] fix: fix topic route when topic deleted [rocketmq]

Posted by "HScarb (via GitHub)" <gi...@apache.org>.
HScarb commented on code in PR #8027:
URL: https://github.com/apache/rocketmq/pull/8027#discussion_r1575752100


##########
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java:
##########
@@ -832,6 +832,7 @@ public boolean updateTopicRouteInfoFromNameServer(final String topic, boolean is
                         }
                     } else {
                         log.warn("updateTopicRouteInfoFromNameServer, getTopicRouteInfoFromNameServer return null, Topic: {}. [{}]", topic, this.clientId);
+                        this.topicRouteTable.remove(topic);

Review Comment:
   OK, I will revert this. But there is no mechanism for the producer client to remove the inexistent topic routes in `topicPublishInfoTable`.



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


Re: [PR] [ISSUE #8025] fix: fix topic route when topic deleted [rocketmq]

Posted by "cserwen (via GitHub)" <gi...@apache.org>.
cserwen commented on code in PR #8027:
URL: https://github.com/apache/rocketmq/pull/8027#discussion_r1593806191


##########
client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java:
##########
@@ -2007,6 +2007,7 @@ public TopicRouteData getTopicRouteInfoFromNameServer(final String topic, final
             case ResponseCode.TOPIC_NOT_EXIST: {
                 if (allowTopicNotExist) {
                     log.warn("get Topic [{}] RouteInfoFromNameServer is not exist value", topic);
+                    return null;

Review Comment:
   This may cause some npe, maybe need to check, such as https://github.com/apache/rocketmq/blob/ad027560780c2af801e4bcb447d85bf0df62071a/proxy/src/main/java/org/apache/rocketmq/proxy/service/admin/DefaultAdminService.java#L60-L85



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


Re: [PR] [ISSUE #8025] fix: fix topic route when topic deleted [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8027:
URL: https://github.com/apache/rocketmq/pull/8027#issuecomment-2864739332

   This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR.


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


Re: [PR] [ISSUE #8025] fix: fix topic route when topic deleted [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #8027: [ISSUE #8025] fix: fix topic route when topic deleted
URL: https://github.com/apache/rocketmq/pull/8027


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


Re: [PR] [ISSUE #8025] fix: fix topic route when topic deleted [rocketmq]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #8027:
URL: https://github.com/apache/rocketmq/pull/8027#issuecomment-2082023174

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/8027?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 42.80%. Comparing base [(`04dddec`)](https://app.codecov.io/gh/apache/rocketmq/commit/04dddecdfd777d0529304c4a533adab8db439dd9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`c8e1ef8`)](https://app.codecov.io/gh/apache/rocketmq/pull/8027?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #8027      +/-   ##
   =============================================
   - Coverage      42.82%   42.80%   -0.02%     
   - Complexity     10345    10350       +5     
   =============================================
     Files           1270     1270              
     Lines          88677    88678       +1     
     Branches       11398    11398              
   =============================================
   - Hits           37973    37961      -12     
   - Misses         46004    46017      +13     
     Partials        4700     4700              
   ```
   
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/rocketmq/pull/8027?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


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


Re: [PR] [ISSUE #8025] fix: fix topic route when topic deleted [rocketmq]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #8027:
URL: https://github.com/apache/rocketmq/pull/8027#discussion_r1569847268


##########
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java:
##########
@@ -832,6 +832,7 @@ public boolean updateTopicRouteInfoFromNameServer(final String topic, boolean is
                         }
                     } else {
                         log.warn("updateTopicRouteInfoFromNameServer, getTopicRouteInfoFromNameServer return null, Topic: {}. [{}]", topic, this.clientId);
+                        this.topicRouteTable.remove(topic);

Review Comment:
   It is the client's protection policy and cannot be directly deleted



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


Re: [PR] [ISSUE #8025] fix: fix topic route when topic deleted [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8027:
URL: https://github.com/apache/rocketmq/pull/8027#issuecomment-2870363413

   This PR was closed because it has been inactive for 3 days since being marked as stale.


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


Re: [PR] [ISSUE #8025] fix: fix topic route when topic deleted [rocketmq]

Posted by "cserwen (via GitHub)" <gi...@apache.org>.
cserwen commented on code in PR #8027:
URL: https://github.com/apache/rocketmq/pull/8027#discussion_r1593806191


##########
client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java:
##########
@@ -2007,6 +2007,7 @@ public TopicRouteData getTopicRouteInfoFromNameServer(final String topic, final
             case ResponseCode.TOPIC_NOT_EXIST: {
                 if (allowTopicNotExist) {
                     log.warn("get Topic [{}] RouteInfoFromNameServer is not exist value", topic);
+                    return null;

Review Comment:
   This may cause sime npe, maybe need to check, such as https://github.com/apache/rocketmq/blob/ad027560780c2af801e4bcb447d85bf0df62071a/proxy/src/main/java/org/apache/rocketmq/proxy/service/admin/DefaultAdminService.java#L60-L85



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