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/23 03:30:39 UTC

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

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


##########
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_GETREPLICAINFO) {
+                        registerBrokerToController();

Review Comment:
   how about try to register again after a while?



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