Aias00 opened a new issue, #10801:
URL: https://github.com/apache/rocketmq/issues/10801

   ### Before Creating the Bug Report
   
   - [x] I found a bug, not just asking a question, which should be created in 
GitHub Issues.
   - [x] I have searched the existing issues and believe this is not a 
duplicate.
   - [x] I have confirmed that this bug belongs to the current repository.
   
   ### Describe the Bug
   
   `DefaultAdminService#topicExist` currently catches every `Throwable` from 
NameServer route lookup and returns `false`:
   
   ```java
   try {
       topicRouteData = this.getTopicRouteDataDirectlyFromNameServer(topic);
       topicExist = topicRouteData != null;
   } catch (Throwable e) {
       topicExist = false;
   }
   ```
   
   This treats network failures, authorization failures, serialization bugs, 
and other unexpected errors as "topic does not exist". In admin flows this can 
hide the real failure and make the caller continue with the wrong diagnosis.
   
   This is inconsistent with `createTopicOnTopicBrokerIfNotExist`, which 
already uses `TopicRouteHelper.isTopicNotExistError(e)` to distinguish a real 
not-found response from other failures.
   
   ### Expected Behavior
   
   `topicExist` should return `false` only for explicit topic-not-found errors. 
Other route lookup failures should be surfaced to the caller instead of being 
silently converted to "not exist".
   
   ### Scope
   
   RocketMQ Studio Track 2 / Proxy Admin correctness. This affects Proxy-side 
admin checks that rely on NameServer route lookup before reporting or creating 
metadata.
   
   ### Proposed Fix
   
   Use `TopicRouteHelper.isTopicNotExistError(e)` in `topicExist`. Return 
`false` for topic-not-found, and throw an `IllegalStateException` for 
unexpected failures. Add regression tests for both cases.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to