You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by GitBox <gi...@apache.org> on 2019/06/25 01:27:54 UTC

[GitHub] [incubator-heron] nwangtw commented on a change in pull request #3299: Retry tunnel setup when it fails

nwangtw commented on a change in pull request #3299: Retry tunnel setup when it fails
URL: https://github.com/apache/incubator-heron/pull/3299#discussion_r296974708
 
 

 ##########
 File path: heron/statemgrs/src/java/org/apache/heron/statemgr/zookeeper/curator/CuratorStateManager.java
 ##########
 @@ -83,17 +84,24 @@ public void initialize(Config newConfig) {
         NetworkUtils.TunnelConfig.build(config, NetworkUtils.HeronSystem.STATE_MANAGER);
 
     if (tunnelConfig.isTunnelNeeded()) {
-      Pair<String, List<Process>> tunneledResults = setupZkTunnel(tunnelConfig);
+      for (int setupCount = 0;; ++setupCount) {
+        Pair<String, List<Process>> tunneledResults = setupZkTunnel(tunnelConfig);
+        String newConnectionString = tunneledResults.first;
+
+        // If tunnel can't be setup correctly. Retry or bail.
+        if (newConnectionString.isEmpty()) {
+          if (setupCount < TUNNEL_SETUP_RETRY) {
+            continue;  // Retry
 
 Review comment:
   make sense. thx.

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


With regards,
Apache Git Services