[GitHub] [rocketmq] vongosling commented on a change in pull request #1458: [ISSUE #1457] Dynamically effective namesrvAddr for name server auto-scaling

2019-09-17 Thread GitBox
vongosling commented on a change in pull request #1458: [ISSUE #1457] 
Dynamically effective namesrvAddr for name server auto-scaling
URL: https://github.com/apache/rocketmq/pull/1458#discussion_r325060772
 
 

 ##
 File path: 
broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java
 ##
 @@ -388,6 +388,20 @@ public void run() {
 }
 }, 1000 * 10, 1000 * 60, TimeUnit.MILLISECONDS);
 
+if (this.brokerConfig.isWatchNamesrvAddr()) {
+this.scheduledExecutorService.scheduleAtFixedRate(new 
Runnable() {
+
+@Override
+public void run() {
+try {
+
BrokerController.this.brokerOuterAPI.updateNameServerAddressList(brokerConfig.getNamesrvAddr());
 
 Review comment:
   Do we need to filter out unnecessary update operation?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [rocketmq] vongosling commented on a change in pull request #1458: [ISSUE #1457] Dynamically effective namesrvAddr for name server auto-scaling

2019-09-17 Thread GitBox
vongosling commented on a change in pull request #1458: [ISSUE #1457] 
Dynamically effective namesrvAddr for name server auto-scaling
URL: https://github.com/apache/rocketmq/pull/1458#discussion_r325058853
 
 

 ##
 File path: 
broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java
 ##
 @@ -388,6 +388,20 @@ public void run() {
 }
 }, 1000 * 10, 1000 * 60, TimeUnit.MILLISECONDS);
 
+if (this.brokerConfig.isWatchNamesrvAddr()) {
+this.scheduledExecutorService.scheduleAtFixedRate(new 
Runnable() {
+
+@Override
+public void run() {
+try {
+
BrokerController.this.brokerOuterAPI.updateNameServerAddressList(brokerConfig.getNamesrvAddr());
 
 Review comment:
   scheduledExecutorService is a global SingleThreadScheduledExecutor, how do 
we make sure that we have a reasonable schedule, and that if the schedule 
fails, it really doesn't affect the other logic?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services