2121import io .netty .channel .ChannelHandlerContext ;
2222import java .util .Optional ;
2323import java .util .concurrent .TimeUnit ;
24- import java .util .concurrent .atomic .AtomicBoolean ;
2524import org .apache .rocketmq .common .MQVersion ;
2625import org .apache .rocketmq .common .constant .LoggerName ;
2726import org .apache .rocketmq .common .help .FAQUrl ;
@@ -43,8 +42,6 @@ public class ClientRequestProcessor implements NettyRequestProcessor {
4342 protected NamesrvController namesrvController ;
4443 private long startupTimeMillis ;
4544
46- private AtomicBoolean needCheckNamesrvReady = new AtomicBoolean (true );
47-
4845 public ClientRequestProcessor (final NamesrvController namesrvController ) {
4946 this .namesrvController = namesrvController ;
5047 this .startupTimeMillis = System .currentTimeMillis ();
@@ -62,7 +59,7 @@ public RemotingCommand getRouteInfoByTopic(ChannelHandlerContext ctx,
6259 final GetRouteInfoRequestHeader requestHeader =
6360 (GetRouteInfoRequestHeader ) request .decodeCommandCustomHeader (GetRouteInfoRequestHeader .class );
6461
65- boolean namesrvReady = needCheckNamesrvReady . get () && System .currentTimeMillis () - startupTimeMillis >= TimeUnit .SECONDS .toMillis (namesrvController .getNamesrvConfig ().getWaitSecondsForService ());
62+ boolean namesrvReady = System .currentTimeMillis () - startupTimeMillis >= TimeUnit .SECONDS .toMillis (namesrvController .getNamesrvConfig ().getWaitSecondsForService ());
6663
6764 if (namesrvController .getNamesrvConfig ().isNeedWaitForService () && !namesrvReady ) {
6865 log .warn ("name server not ready. request code {} " , request .getCode ());
@@ -74,11 +71,6 @@ public RemotingCommand getRouteInfoByTopic(ChannelHandlerContext ctx,
7471 TopicRouteData topicRouteData = this .namesrvController .getRouteInfoManager ().pickupTopicRouteData (requestHeader .getTopic ());
7572
7673 if (topicRouteData != null ) {
77- //topic route info register success ,so disable namesrvReady check
78- if (needCheckNamesrvReady .get ()) {
79- needCheckNamesrvReady .set (false );
80- }
81-
8274 if (this .namesrvController .getNamesrvConfig ().isOrderMessageEnable ()) {
8375 String orderTopicConf =
8476 this .namesrvController .getKvConfigManager ().getKVConfig (NamesrvUtil .NAMESPACE_ORDER_TOPIC_CONFIG ,
0 commit comments