curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject curator git commit: moved to ZK 3.5.1.
Date Thu, 10 Sep 2015 14:22:18 GMT
Repository: curator
Updated Branches:
  refs/heads/CURATOR-261 911f02b15 -> fad270861


moved to ZK 3.5.1.


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

Branch: refs/heads/CURATOR-261
Commit: fad270861feb4dbda36fdea76b4db9ec29e92001
Parents: 911f02b
Author: randgalt <randgalt@apache.org>
Authored: Thu Sep 10 09:22:11 2015 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Thu Sep 10 09:22:11 2015 -0500

----------------------------------------------------------------------
 .../recipes/leader/ChaosMonkeyCnxnFactory.java  |  2 --
 .../curator/test/TestingZooKeeperMain.java      | 36 +++++++++++++++-----
 pom.xml                                         | 11 +-----
 3 files changed, 29 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/fad27086/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java
b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java
index 3aeec81..4cb342c 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java
@@ -31,8 +31,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.SocketChannel;
 
 /**
  * A connection factory that will behave like the NIOServerCnxnFactory except that

http://git-wip-us.apache.org/repos/asf/curator/blob/fad27086/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java
----------------------------------------------------------------------
diff --git a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java
b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java
index 702824a..a4cca8e 100644
--- a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java
+++ b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java
@@ -30,12 +30,14 @@ import org.apache.zookeeper.server.quorum.QuorumPeer;
 import org.apache.zookeeper.server.quorum.QuorumPeerConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.testng.Assert;
 import javax.management.JMException;
 import java.io.IOException;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.nio.channels.ServerSocketChannel;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 
 public class TestingZooKeeperMain implements ZooKeeperMainFace
@@ -48,7 +50,9 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace
     private volatile ServerCnxnFactory cnxnFactory;
     private volatile ZooKeeperServer zkServer;
 
-    static final int MAX_WAIT_MS = new Timing().milliseconds();
+    private static final Timing timing = new Timing();
+
+    static final int MAX_WAIT_MS = timing.milliseconds();
 
     @Override
     public void kill()
@@ -124,7 +128,7 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace
     @Override
     public void blockUntilStarted() throws Exception
     {
-        latch.await();
+        Assert.assertTrue(timing.awaitLatch(latch));
 
         if ( zkServer != null )
         {
@@ -139,7 +143,7 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace
         }
         else
         {
-            throw new Exception("No zkServer. zkServer is volatile: " + Modifier.isVolatile(cnxnFactory.getClass().getDeclaredField("zkServer").getModifiers()));
+            throw new Exception("No zkServer.");
         }
 
         Exception exception = startingException.get();
@@ -201,9 +205,17 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace
             txnLog = new FileTxnSnapLog(config.getDataLogDir(), config.getDataDir());
             zkServer = new TestZooKeeperServer(txnLog, config);
 
-            cnxnFactory = ServerCnxnFactory.createFactory();
-            cnxnFactory.configure(config.getClientPortAddress(),
-                config.getMaxClientCnxns());
+            try
+            {
+                cnxnFactory = ServerCnxnFactory.createFactory();
+                cnxnFactory.configure(config.getClientPortAddress(),
+                    config.getMaxClientCnxns());
+            }
+            catch ( IOException e )
+            {
+                log.info("Could not server. Waiting and trying one more time.", e);
+                timing.sleepABit();
+            }
             cnxnFactory.startup(zkServer);
             latch.countDown();
             cnxnFactory.join();
@@ -228,6 +240,8 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace
             super(txnLog, config.getTickTime(), config.getMinSessionTimeout(), config.getMaxSessionTimeout(),
null);
         }
 
+        private final AtomicBoolean isRunning = new AtomicBoolean(false);
+
         protected void registerJMX()
         {
             // NOP
@@ -239,11 +253,17 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace
             // NOP
         }
 
+        @Override
+        public boolean isRunning()
+        {
+            return isRunning.get() || super.isRunning();
+        }
+
         public void noteStartup()
         {
             synchronized (this) {
-                running = true;
-                notifyAll();
+                isRunning.set(true);
+                this.notifyAll();
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/fad27086/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 59ed3e0..567eb8f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,7 @@
         <jdk-version>1.7</jdk-version>
 
         <!-- versions -->
-        <zookeeper-version>3.5.0-alpha</zookeeper-version>
+        <zookeeper-version>3.5.1-alpha</zookeeper-version>
         <maven-project-info-reports-plugin-version>2.7</maven-project-info-reports-plugin-version>
         <maven-bundle-plugin-version>2.3.7</maven-bundle-plugin-version>
         <maven-javadoc-plugin-version>2.10.3</maven-javadoc-plugin-version>
@@ -79,7 +79,6 @@
         <maven-shade-plugin-version>2.3</maven-shade-plugin-version>
         <slf4j-version>1.7.6</slf4j-version>
         <clirr-maven-plugin-version>2.6.1</clirr-maven-plugin-version>
-        <maven-surefire-plugin-version>2.18.1</maven-surefire-plugin-version>
 
         <!-- OSGi Properties -->
         <osgi.export.package />
@@ -546,12 +545,6 @@
                     <artifactId>clirr-maven-plugin</artifactId>
                     <version>${clirr-maven-plugin-version}</version>
                 </plugin>
-
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-surefire-plugin</artifactId>
-                    <version>${maven-surefire-plugin-version}</version>
-                </plugin>
             </plugins>
         </pluginManagement>
 
@@ -630,8 +623,6 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <redirectTestOutputToFile>true</redirectTestOutputToFile>
-                    <threadCount>1</threadCount>
-                    <reuseForks>false</reuseForks>
                 </configuration>
             </plugin>
 


Mime
View raw message