From 32e0f68a9bc380905746eec0e7d392594ec132fb Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Wed, 19 Oct 2022 05:57:52 +1100 Subject: [PATCH] SOLR-16450: waitForState to cleanly unregister watches if there is a failure --- .../src/java/org/apache/solr/common/cloud/ZkStateReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java index 573cf45b6c5..26239784115 100644 --- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java +++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java @@ -1896,9 +1896,9 @@ public void waitForState( return matches; }; - registerCollectionStateWatcher(collection, watcher); try { + registerCollectionStateWatcher(collection, watcher); // wait for the watcher predicate to return true, or time out if (!latch.await(wait, unit)) throw new TimeoutException(