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/24 21:50:19 UTC

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

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

 ##########
 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:
   wait for some time before another retry will be more favorable.

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