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:40:13 UTC

svn commit: r1554981 - /zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java

Author: fpj
Date: Fri Jan  3 00:40:13 2014
New Revision: 1554981

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

Modified:
    zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java

Modified: zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java?rev=1554981&r1=1554980&r2=1554981&view=diff
==============================================================================
--- zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java (original)
+++ zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java Fri Jan  3 00:40:13 2014
@@ -325,6 +325,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 {
@@ -336,6 +339,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 {