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

   ### Which Issue(s) This PR Fixes
   
   Fixes #11072
   
   ### Brief Description
   
   A topic route query can execute or finish while NameServer shutdown is 
cleaning up Broker connections and route data. Returning that result can expose 
a reduced route or `TOPIC_NOT_EXIST` while the NameServer is no longer ready to 
serve routing information.
   
   Mark the controller as shutting down before resource cleanup. Check that 
state before route lookup and again after the response is constructed, 
returning `SYSTEM_ERROR` with `name server not ready` and no body when shutdown 
has begun. The second check also discards results from queries that were 
already running. The existing connection shutdown sequence remains unchanged.
   
   ### How Did You Test This Change?
   
   19 tests passed with no failures, errors, or skips on JDK 21:
   
   - `NamesrvControllerTest`: shutdown state is visible before resources are 
closed.
   - `ClientRequestProcessorTest`: requests are rejected for old and new client 
versions; shutdown during lookup discards both successful route data and a 
missing-route result, including when startup readiness waiting is disabled.
   - `ClusterTestRequestProcessorTest`: existing route processor behavior 
remains covered.
   
   Clean reactor build and Checkstyle passed. SpotBugs reported no findings for 
the two modified production classes. JaCoCo was skipped.
   
   ```shell
   mvn -B -pl namesrv -am clean test \
     
-Dtest=NamesrvControllerTest,ClientRequestProcessorTest,ClusterTestRequestProcessorTest
 \
     -Dsurefire.failIfNoSpecifiedTests=false -Djacoco.skip=true \
     
-Dspotbugs.onlyAnalyze=org.apache.rocketmq.namesrv.NamesrvController,org.apache.rocketmq.namesrv.processor.ClientRequestProcessor
   ```
   


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