You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/08/22 01:54:03 UTC

[GitHub] [rocketmq] hzh0425 commented on a diff in pull request #4862: [ISSUE #4857] Fix broker can't auto register to controller again

hzh0425 commented on code in PR #4862:
URL: https://github.com/apache/rocketmq/pull/4862#discussion_r950946164


##########
broker/src/main/java/org/apache/rocketmq/broker/controller/ReplicasManager.java:
##########
@@ -347,6 +351,12 @@ private void schedulingSyncBrokerMetadata() {
                 }
             } catch (final Exception e) {
                 LOGGER.warn("Error happen when get broker {}'s metadata", this.brokerConfig.getBrokerName(), e);
+                if (e instanceof MQBrokerException) {
+                    int code = ((MQBrokerException) e).getResponseCode();
+                    if (code == CONTROLLER_INVALID_REQUEST || code == CONTROLLER_NOT_LEADER) {

Review Comment:
   I think you are right



-- 
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: dev-unsubscribe@rocketmq.apache.org

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