You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2017/05/10 11:38:38 UTC

[1/3] curator git commit: don't clear quorumPeer as it might cause an NPE

Repository: curator
Updated Branches:
  refs/heads/CURATOR-411 88d56219e -> 96cecb2bb


don't clear quorumPeer as it might cause an NPE


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

Branch: refs/heads/CURATOR-411
Commit: fb972db618eec11d350fc490010b014b8e3523fc
Parents: 88d5621
Author: randgalt <ra...@apache.org>
Authored: Wed May 10 13:32:52 2017 +0200
Committer: randgalt <ra...@apache.org>
Committed: Wed May 10 13:32:52 2017 +0200

----------------------------------------------------------------------
 .../apache/curator/test/TestingQuorumPeerMain.java    | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/fb972db6/curator-test/src/main/java/org/apache/curator/test/TestingQuorumPeerMain.java
----------------------------------------------------------------------
diff --git a/curator-test/src/main/java/org/apache/curator/test/TestingQuorumPeerMain.java b/curator-test/src/main/java/org/apache/curator/test/TestingQuorumPeerMain.java
index 3ae464c..3b3ab26 100644
--- a/curator-test/src/main/java/org/apache/curator/test/TestingQuorumPeerMain.java
+++ b/curator-test/src/main/java/org/apache/curator/test/TestingQuorumPeerMain.java
@@ -27,6 +27,8 @@ import java.nio.channels.ServerSocketChannel;
 
 class TestingQuorumPeerMain extends QuorumPeerMain implements ZooKeeperMainFace
 {
+    private volatile boolean isClosed = false;
+
     @Override
     public void kill()
     {
@@ -60,16 +62,10 @@ class TestingQuorumPeerMain extends QuorumPeerMain implements ZooKeeperMainFace
     @Override
     public void close() throws IOException
     {
-        if ( quorumPeer != null )
+        if ( (quorumPeer != null) && !isClosed )
         {
-            try
-            {
-                quorumPeer.shutdown();
-            }
-            finally
-            {
-                quorumPeer = null;
-            }
+            isClosed = true;
+            quorumPeer.shutdown();
         }
     }
 


[2/3] curator git commit: Only change from 5 to 4 to avoid flaky test

Posted by ra...@apache.org.
Only change from 5 to 4 to avoid flaky test


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

Branch: refs/heads/CURATOR-411
Commit: 51eaa426e681c6521b0e313d822d524a9d4efbe1
Parents: fb972db
Author: randgalt <ra...@apache.org>
Authored: Wed May 10 13:33:05 2017 +0200
Committer: randgalt <ra...@apache.org>
Committed: Wed May 10 13:33:05 2017 +0200

----------------------------------------------------------------------
 .../org/apache/curator/framework/imps/TestReconfiguration.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/51eaa426/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java
index 53b9c5f..5ed8a9b 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java
@@ -293,7 +293,7 @@ public class TestReconfiguration extends BaseClassForTests
         cluster = new TestingCluster(5);
         List<TestingZooKeeperServer> servers = cluster.getServers();
         List<InstanceSpec> smallCluster = Lists.newArrayList();
-        for ( int i = 0; i < 3; ++i )   // only start 3 of the 5
+        for ( int i = 0; i < 4; ++i )   // only start 4 of the 5
         {
             TestingZooKeeperServer server = servers.get(i);
             server.start();
@@ -315,7 +315,7 @@ public class TestReconfiguration extends BaseClassForTests
             Assert.assertTrue(timing.awaitLatch(latch));
             byte[] newConfigData = client.getConfig().forEnsemble();
             QuorumVerifier newConfig = toQuorumVerifier(newConfigData);
-            Assert.assertEquals(newConfig.getAllMembers().size(), 3);
+            Assert.assertEquals(newConfig.getAllMembers().size(), 4);
             assertConfig(newConfig, smallCluster);
             Assert.assertEquals(EnsembleTracker.configToConnectionString(newConfig), ensembleProvider.getConnectionString());
         }


[3/3] curator git commit: KeeperException.SessionExpiredException is also valid for testWithNamespaceAndLostSessionAlt

Posted by ra...@apache.org.
KeeperException.SessionExpiredException is also valid for testWithNamespaceAndLostSessionAlt


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

Branch: refs/heads/CURATOR-411
Commit: 96cecb2bbeec6e2deeac2e74188f83d2d0744b65
Parents: 51eaa42
Author: randgalt <ra...@apache.org>
Authored: Wed May 10 13:38:32 2017 +0200
Committer: randgalt <ra...@apache.org>
Committed: Wed May 10 13:38:32 2017 +0200

----------------------------------------------------------------------
 .../org/apache/curator/framework/imps/TestFailedDeleteManager.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/96cecb2b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java
index 41b0bca..5f2d974 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java
@@ -203,7 +203,7 @@ public class TestFailedDeleteManager extends BaseClassForTests
                 namespaceClient.delete().guaranteed().forPath("/test-me");
                 Assert.fail();
             }
-            catch ( KeeperException.ConnectionLossException e )
+            catch ( KeeperException.ConnectionLossException | KeeperException.SessionExpiredException e )
             {
                 // expected
             }