You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/09/08 19:40:03 UTC

[lucene-solr] branch reference_impl_dev updated: @811 Improving ConnectionManager close, zkStateReader timeouts (is ms, not seconds)

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

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/reference_impl_dev by this push:
     new 65ee22d  @811 Improving ConnectionManager close, zkStateReader timeouts (is ms, not seconds)
65ee22d is described below

commit 65ee22d4eee4b3fb9bb059fd697b7ea5ae00b546
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Tue Sep 8 14:39:36 2020 -0500

    @811 Improving ConnectionManager close, zkStateReader timeouts (is ms, not seconds)
---
 solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java            | 2 +-
 solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java | 2 ++
 .../src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java            | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java
index cd75dc5..f82bd89 100644
--- a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java
@@ -154,7 +154,7 @@ public class RecoveryZkTest extends SolrCloudTestCase {
     }
     for (int j = 1; j < replicas.size(); j++) {
       if (numCounts[j] != numCounts[j - 1])
-        fail("Mismatch in counts between replicas");  // TODO improve this!
+        fail("Mismatch in counts between replicas replica1=" + numCounts[j] + " replica2=" + numCounts[j - 1]);  // TODO improve this!
       if (numCounts[j] == 0 && expectDocs)
         fail("Expected docs on shard " + shard.getName() + " but found none");
     }
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
index bdd6e86..7d713c1 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ConnectionManager.java
@@ -183,6 +183,7 @@ public class ConnectionManager implements Watcher, Closeable {
 
   private void updatezk() throws IOException {
     synchronized (keeperLock) {
+      if (isClosed()) return;
       if (keeper != null) {
         ParWork.close(keeper);
       }
@@ -260,6 +261,7 @@ public class ConnectionManager implements Watcher, Closeable {
       }
 
       synchronized (keeperLock) {
+        if (isClosed()) return;
         if (keeper != null) {
           // if there was a problem creating the new SolrZooKeeper
           // or if we cannot run our reconnect command, close the keeper
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
index ae18a2f..a9b9502 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/MiniSolrCloudCluster.java
@@ -751,7 +751,7 @@ public class MiniSolrCloudCluster {
   
   protected CloudHttp2SolrClient buildSolrClient() {
    // return new CloudHttp2SolrClient.Builder(Collections.singletonList(zkServer.getZkHost()), Optional.of("/solr")).build();
-    zkStateReader = new ZkStateReader(zkServer.getZkAddress(), 15, 30);
+    zkStateReader = new ZkStateReader(zkServer.getZkAddress(), 15000, 30000);
     zkStateReader.createClusterStateWatchersAndUpdate();
     return new CloudHttp2SolrClient.Builder(zkStateReader).build();
   }