You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "xyuanlu (via GitHub)" <gi...@apache.org> on 2023/04/28 20:45:14 UTC

[GitHub] [helix] xyuanlu commented on a diff in pull request #2459: retryUntilConnected - add exponential backoff

xyuanlu commented on code in PR #2459:
URL: https://github.com/apache/helix/pull/2459#discussion_r1180806837


##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2019,10 +2023,24 @@ public <T> T retryUntilConnected(final Callable<T> callable)
     }
   }
 
-  private void waitForRetry() {
-    waitUntilConnected(_operationRetryTimeoutInMillis, TimeUnit.MILLISECONDS);
+  /**
+   * ZkClient may have lost the connection to the ZK but can be in cleanup 
+   * stage. Let us make sure that we wait even if the connection appears to 
+   * be connected.
+   */
+  private void waitForRetry(int retryCount) {
+    if (waitUntilConnected(_operationRetryTimeoutInMillis, TimeUnit.MILLISECONDS)) {
+      ExponentialBackoffStrategy retryStrategy =
+        new ExponentialBackoffStrategy(_operationRetryTimeoutInMillis, true);

Review Comment:
   Do you think it is possible to pass in this object? 



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org