You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tubemq.apache.org by GitBox <gi...@apache.org> on 2020/06/10 03:15:58 UTC

[GitHub] [incubator-tubemq] viviel opened a new pull request #148: [TUBEMQ-232] TubeBroker#register2Master, reconnect and wait

viviel opened a new pull request #148:
URL: https://github.com/apache/incubator-tubemq/pull/148


   If the broker fails to register with the master, a total of 5 reconnections will be attempted. But I think we should pause the thread for a period of time every time the connection fails to be reconnected
   ```
   for (int i; i < reconnectionTimes; i++) {
       try {
           tryConnect();
       } catch (Throwable e) {
           try {
               TimeUnit.MILLISECONDS.sleep(200);
           } catch (InterruptedException ignored) {
               //ignore interrupted
           }
       }
   }
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tubemq] zhenjunMa commented on a change in pull request #148: [TUBEMQ-232] TubeBroker#register2Master, reconnect and wait

Posted by GitBox <gi...@apache.org>.
zhenjunMa commented on a change in pull request #148:
URL: https://github.com/apache/incubator-tubemq/pull/148#discussion_r437852026



##########
File path: tubemq-server/src/main/java/org/apache/tubemq/server/broker/TubeBroker.java
##########
@@ -430,6 +430,11 @@ private void register2Master() throws StartupException {
                 if (remainingRetry == 0) {
                     throw new StartupException("Register to master failed!", e);
                 }
+                try {
+                    TimeUnit.MILLISECONDS.sleep(200);

Review comment:
       use ThreadUtil.sleep to replace this




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tubemq] viviel commented on a change in pull request #148: [TUBEMQ-232] TubeBroker#register2Master, reconnect and wait

Posted by GitBox <gi...@apache.org>.
viviel commented on a change in pull request #148:
URL: https://github.com/apache/incubator-tubemq/pull/148#discussion_r437883087



##########
File path: tubemq-server/src/main/java/org/apache/tubemq/server/broker/TubeBroker.java
##########
@@ -430,6 +430,11 @@ private void register2Master() throws StartupException {
                 if (remainingRetry == 0) {
                     throw new StartupException("Register to master failed!", e);
                 }
+                try {
+                    TimeUnit.MILLISECONDS.sleep(200);

Review comment:
       Ha, thanks for the reminder




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [incubator-tubemq] guangxuCheng merged pull request #148: [TUBEMQ-232] TubeBroker#register2Master, reconnect and wait

Posted by GitBox <gi...@apache.org>.
guangxuCheng merged pull request #148:
URL: https://github.com/apache/incubator-tubemq/pull/148


   


----------------------------------------------------------------
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:
users@infra.apache.org