This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/curator.git


The following commit(s) were added to refs/heads/master by this push:
     new 72fd977e CURATOR-720: Stop retry if client is closed (#511)
72fd977e is described below

commit 72fd977eec61e66a718430a49e63eb71f9d146ef
Author: Houston Putman <[email protected]>
AuthorDate: Thu Dec 12 01:39:26 2024 -0600

    CURATOR-720: Stop retry if client is closed (#511)
---
 .../src/main/java/org/apache/curator/CuratorZookeeperClient.java       | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java 
b/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
index ecb072f6..1007b598 100644
--- 
a/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
+++ 
b/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java
@@ -399,6 +399,9 @@ public class CuratorZookeeperClient implements Closeable {
     public void internalBlockUntilConnectedOrTimedOut() throws 
InterruptedException {
         long waitTimeMs = connectionTimeoutMs;
         while (!state.isConnected() && (waitTimeMs > 0)) {
+            if (!started.get()) {
+                throw new IllegalStateException("Client is not started or has 
been closed");
+            }
             final CountDownLatch latch = new CountDownLatch(1);
             Watcher tempWatcher = new Watcher() {
                 @Override

Reply via email to