xyuanlu commented on code in PR #2459:
URL: https://github.com/apache/helix/pull/2459#discussion_r1179831338
##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2019,8 +2020,21 @@ 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);
+ try {
+ Thread.sleep(retryStrategy.getNextWaitInterval(retryCount));
+ } catch (InterruptedException ex) {
+ // we don't need to re-throw.
+ }
+ }
}
public void setCurrentState(KeeperState currentState) {
Review Comment:
Thanks for the reply. Either is ok. :D
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]