You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "rahulrane50 (via GitHub)" <gi...@apache.org> on 2023/03/07 19:09:24 UTC

[GitHub] [helix] rahulrane50 commented on a diff in pull request #2392: check connnect only called once

rahulrane50 commented on code in PR #2392:
URL: https://github.com/apache/helix/pull/2392#discussion_r1128424716


##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -2508,11 +2509,17 @@ public void connect(final long maxMsToWaitUntilConnected)
    */
   public void connect(final long maxMsToWaitUntilConnected, Watcher watcher)
       throws ZkInterruptedException, ZkTimeoutException, IllegalStateException {
+    acquireEventLock();
+
     if (isClosed()) {
       throw new IllegalStateException("ZkClient already closed!");
     }
+    if (_currentState != null) {
+      throw new IllegalStateException(
+          "ZkClient is not in init state. connect() has already been called.");

Review Comment:
   +1



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