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 02:49:12 UTC

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

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


##########
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 will adding a new response code to indicate this situation.  and ReplicasInfoManager method to process different request code, if nothing to do will return ResponseCode.CONTROLLER_INVALID_REQUEST code. I think different handle should return coding related to processing. I will submit a PR to deal with in the future.



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