You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by fp...@apache.org on 2014/01/03 01:44:27 UTC

svn commit: r1554983 - /zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/test/ClientBase.java

Author: fpj
Date: Fri Jan  3 00:44:27 2014
New Revision: 1554983

URL: http://svn.apache.org/r1554983
Log:
ZOOKEEPER-1852. ServerCnxnFactory instance is not properly cleanedup (Rakesh R via fpj)


Modified:
    zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/test/ClientBase.java

Modified: zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/test/ClientBase.java
URL: http://svn.apache.org/viewvc/zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/test/ClientBase.java?rev=1554983&r1=1554982&r2=1554983&view=diff
==============================================================================
--- zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/test/ClientBase.java (original)
+++ zookeeper/branches/branch-3.4/src/java/test/org/apache/zookeeper/test/ClientBase.java Fri Jan  3 00:44:27 2014
@@ -324,6 +324,9 @@ public abstract class ClientBase extends
         return Integer.parseInt(portstr);
     }
 
+    /**
+     * Starting the given server instance
+     */
     public static void startServerInstance(File dataDir,
             ServerCnxnFactory factory, String hostPort) throws IOException,
             InterruptedException {
@@ -335,6 +338,20 @@ public abstract class ClientBase extends
                 "127.0.0.1:" + port, CONNECTION_TIMEOUT));
     }
 
+    /**
+     * This method instantiates a new server. Starting of the server
+     * instance has been moved to a separate method
+     * {@link ClientBase#startServerInstance(File, ServerCnxnFactory, String)}.
+     * Because any exception on starting the server would leave the server
+     * running and the caller would not be able to shutdown the instance. This
+     * may affect other test cases.
+     * 
+     * @return newly created server instance
+     * 
+     * @see <a
+     *      href="https://issues.apache.org/jira/browse/ZOOKEEPER-1852">ZOOKEEPER-1852</a>
+     *      for more information.
+     */
     public static ServerCnxnFactory createNewServerInstance(
             ServerCnxnFactory factory, String hostPort, int maxCnxns)
             throws IOException, InterruptedException {