Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-12101

Tests: Timeout for zk shortened by config of server

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.4, 8.0
    • None
    • None

    Description

      After some digging I found this code in ZkTestServer:

      public void run() throws InterruptedException {
        log.info("STARTING ZK TEST SERVER");
        // we don't call super.distribSetUp
        zooThread = new Thread() {
          
          @Override
          public void run() {
            ServerConfig config = new ServerConfig() {
      
              {
                setClientPort(ZkTestServer.this.clientPort);
                this.dataDir = zkDir;
                this.dataLogDir = zkDir;
                this.tickTime = theTickTime;
              }
              
              public void setClientPort(int clientPort) {
                if (clientPortAddress != null) {
                  try {
                    this.clientPortAddress = new InetSocketAddress(
                            InetAddress.getByName(clientPortAddress.getHostName()), clientPort);
                  } catch (UnknownHostException e) {
                    throw new RuntimeException(e);
                  }
                } else {
                  this.clientPortAddress = new InetSocketAddress(clientPort);
                }
                log.info("client port:" + this.clientPortAddress);
              }
            };
      
            try {
              zkServer.runFromConfig(config);
            } catch (Throwable e) {
              throw new RuntimeException(e);
            }
          }
        };
      
      

      And what I noticed is that min/max timeouts are unset and theTickTime is onlly ever set to a big blue 1000 leading to default min/max timeout values of 2/20 seconds (https://discuss.pivotal.io/hc/en-us/articles/205187157-Pivotal-HD-About-how-to-correctly-config-zookeeper-session-timeout-parameter-minSessionTimeout-and-maxSessionTimeout --> jibes with the zk code I see in my editor).
       
      I suggest we provide explicit min/max configs in the anonymous inner class here setting them back to the 3/60 defaults. 

      Attachments

        Activity

          People

            markrmiller@gmail.com Mark Miller
            gus Gus Heck
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h