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 2018/03/17 18:16:48 UTC

lucene-solr:master: SOLR-12101: ZkTestServer was not handling connection timeout settings properly.

Repository: lucene-solr
Updated Branches:
  refs/heads/master 4b08efcf1 -> c98ab259c


SOLR-12101: ZkTestServer was not handling connection timeout settings properly.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c98ab259
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c98ab259
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c98ab259

Branch: refs/heads/master
Commit: c98ab259c503d5b5713ae238647cf58ad82b71ae
Parents: 4b08efc
Author: markrmiller <ma...@apache.org>
Authored: Fri Mar 16 14:24:59 2018 -0500
Committer: markrmiller <ma...@apache.org>
Committed: Sat Mar 17 12:36:48 2018 -0500

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  2 ++
 .../org/apache/solr/cloud/ZkTestServer.java     | 29 +++++++++++++++++---
 2 files changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c98ab259/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 0b0145c..d2eff52 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -84,6 +84,8 @@ Other Changes
 
 * SOLR-12091: Rename TimeSource.getTime to getTimeNs. (ab)
 
+* SOLR-12101: ZkTestServer was not handling connection timeout settings properly. (Gus Heck via Mark Miller)
+
 ==================  7.3.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c98ab259/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
index e432bb0..216d3fe 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
@@ -73,6 +73,9 @@ public class ZkTestServer {
   private volatile Thread zooThread;
   
   private int theTickTime = TICK_TIME;
+  // SOLR-12101 - provide defaults to avoid max timeout 20 enforced by our server instance when tick time is 1000
+  private int maxSessionTimeout = 60000;
+  private int minSessionTimeout = 3000;
 
   static public enum LimitViolationAction {
     IGNORE,
@@ -94,14 +97,14 @@ public class ZkTestServer {
       } catch (JMException e) {
         log.warn("Unable to register log4j JMX control", e);
       }
-      
+
       ServerConfig config = new ServerConfig();
       if (args.length == 1) {
         config.parse(args[0]);
       } else {
         config.parse(args);
       }
-      
+
       runFromConfig(config);
     }
 
@@ -470,6 +473,8 @@ public class ZkTestServer {
             this.dataDir = zkDir;
             this.dataLogDir = zkDir;
             this.tickTime = theTickTime;
+            this.maxSessionTimeout = ZkTestServer.this.maxSessionTimeout;
+            this.minSessionTimeout = ZkTestServer.this.minSessionTimeout;
           }
           
           public void setClientPort(int clientPort) {
@@ -555,13 +560,13 @@ public class ZkTestServer {
   public static class HostPort {
     String host;
     int port;
-    
+
     HostPort(String host, int port) {
       this.host = host;
       this.port = port;
     }
   }
-  
+
   /**
    * Send the 4letterword
    * @param host the destination host
@@ -633,4 +638,20 @@ public class ZkTestServer {
   public ZKServerMain.WatchLimiter getLimiter() {
     return zkServer.getLimiter();
   }
+
+  public int getMaxSessionTimeout() {
+    return maxSessionTimeout;
+  }
+
+  public int getMinSessionTimeout() {
+    return minSessionTimeout;
+  }
+
+  public void setMaxSessionTimeout(int maxSessionTimeout) {
+    this.maxSessionTimeout = maxSessionTimeout;
+  }
+
+  public void setMinSessionTimeout(int minSessionTimeout) {
+    this.minSessionTimeout = minSessionTimeout;
+  }
 }