Solr
  1. Solr
  2. SOLR-8253

AbstractDistribZkTestBase can fail to shutdown its ZkServer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4
    • Component/s: None
    • Labels:
      None

      Description

      If there's an error shutting down the jetty servers, then zkServer.shutdown() won't get called. This ends up hiding actual errors from test failures with thread-leak messages.

        Activity

        Hide
        Alan Woodward added a comment -

        See http://jenkins.thetaphi.de/job/Lucene-Solr-5.x-Linux/14548/ for an example.

        Patch is trivial enough:

        diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java
        index 300f628..84a16ff 100644
        --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java
        +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java
        @@ -268,8 +268,12 @@ public abstract class AbstractDistribZkTestBase extends BaseDistributedSearchTes
             System.clearProperty(MockDirectoryFactory.SOLR_TESTS_ALLOW_READING_FILES_STILL_OPEN_FOR_WRITE);
        
             resetExceptionIgnores();
        -    super.distribTearDown();
        -    zkServer.shutdown();
        +    try {
        +      super.distribTearDown();
        +    }
        +    finally {
        +      zkServer.shutdown();
        +    }
           }
        
           protected void printLayout() throws Exception {
        
        Show
        Alan Woodward added a comment - See http://jenkins.thetaphi.de/job/Lucene-Solr-5.x-Linux/14548/ for an example. Patch is trivial enough: diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java index 300f628..84a16ff 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java @@ -268,8 +268,12 @@ public abstract class AbstractDistribZkTestBase extends BaseDistributedSearchTes System .clearProperty(MockDirectoryFactory.SOLR_TESTS_ALLOW_READING_FILES_STILL_OPEN_FOR_WRITE); resetExceptionIgnores(); - super .distribTearDown(); - zkServer.shutdown(); + try { + super .distribTearDown(); + } + finally { + zkServer.shutdown(); + } } protected void printLayout() throws Exception {
        Hide
        ASF subversion and git services added a comment -

        Commit 1713443 from Alan Woodward in branch 'dev/trunk'
        [ https://svn.apache.org/r1713443 ]

        SOLR-8253: Ensure ZK server is always shutdown in AbstractDistribZkTestBase

        Show
        ASF subversion and git services added a comment - Commit 1713443 from Alan Woodward in branch 'dev/trunk' [ https://svn.apache.org/r1713443 ] SOLR-8253 : Ensure ZK server is always shutdown in AbstractDistribZkTestBase
        Hide
        ASF subversion and git services added a comment -

        Commit 1713444 from Alan Woodward in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1713444 ]

        SOLR-8253: Ensure ZK server is always shutdown in AbstractDistribZkTestBase

        Show
        ASF subversion and git services added a comment - Commit 1713444 from Alan Woodward in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1713444 ] SOLR-8253 : Ensure ZK server is always shutdown in AbstractDistribZkTestBase

          People

          • Assignee:
            Unassigned
            Reporter:
            Alan Woodward
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development