RongtongJin commented on code in PR #4862:
URL: https://github.com/apache/rocketmq/pull/4862#discussion_r953391626
##########
broker/src/main/java/org/apache/rocketmq/broker/controller/ReplicasManager.java:
##########
@@ -347,6 +351,17 @@ 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_BROKER_METADATA_NOT_EXIST) {
+ try {
+ registerBrokerToController();
+ TimeUnit.SECONDS.sleep(2);
+ } catch (InterruptedException ignore) {
+
+ }
+ }
+ }
Review Comment:
How about catching MQBrokerException before Exception? In addition, could
you rebase or merge the latest develop branch to this pull request? We add new
rules for merging
--
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]