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 2018/12/03 01:17:42 UTC
[1/3] curator git commit: CURATOR-472
Repository: curator
Updated Branches:
refs/heads/master eebff920c -> 26ffdfb89
CURATOR-472
Fixed 2 problems: 1) internalClose can be called from a ZooKeeper background thread (as part of a Watcher callback). Calling ZooKeeper.close with a waitForShutdownTimeoutMs in this case will cause a deadlock as no other events can be processed until the current thread exits. 2) All TTL tests must set the system property "zookeeper.extendedTypesEnabled"
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b91036be
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b91036be
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b91036be
Branch: refs/heads/master
Commit: b91036be07aaddc4ed2d81615b08b33075e923af
Parents: eebff92
Author: randgalt <ra...@apache.org>
Authored: Sat Dec 1 10:55:55 2018 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Dec 1 10:55:55 2018 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/curator/HandleHolder.java | 11 +++++++++--
.../curator/framework/imps/TestFrameworkEdges.java | 6 ++++++
.../framework/recipes/nodes/TestPersistentTtlNode.java | 6 ++++++
3 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/b91036be/curator-client/src/main/java/org/apache/curator/HandleHolder.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/HandleHolder.java b/curator-client/src/main/java/org/apache/curator/HandleHolder.java
index 6c588cf..0917d71 100644
--- a/curator-client/src/main/java/org/apache/curator/HandleHolder.java
+++ b/curator-client/src/main/java/org/apache/curator/HandleHolder.java
@@ -37,7 +37,7 @@ class HandleHolder
private interface Helper
{
ZooKeeper getZooKeeper() throws Exception;
-
+
String getConnectionString();
int getNegotiatedSessionTimeoutMs();
@@ -155,7 +155,14 @@ class HandleHolder
}
};
zooKeeper.register(dummyWatcher); // clear the default watcher so that no new events get processed by mistake
- zooKeeper.close(waitForShutdownTimeoutMs);
+ if ( waitForShutdownTimeoutMs == 0 )
+ {
+ zooKeeper.close();
+ }
+ else
+ {
+ zooKeeper.close(waitForShutdownTimeoutMs);
+ }
}
}
catch ( InterruptedException dummy )
http://git-wip-us.apache.org/repos/asf/curator/blob/b91036be/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
index 86133b8..f9b16af 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
@@ -46,6 +46,7 @@ import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.data.Stat;
import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
@@ -60,6 +61,11 @@ public class TestFrameworkEdges extends BaseClassForTests
{
private final Timing2 timing = new Timing2();
+ @BeforeClass
+ public static void setUpClass() {
+ System.setProperty("zookeeper.extendedTypesEnabled", "true");
+ }
+
@Test
public void testBackgroundLatencyUnSleep() throws Exception
{
http://git-wip-us.apache.org/repos/asf/curator/blob/b91036be/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
index 7bca01f..360c876 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentTtlNode.java
@@ -30,6 +30,7 @@ import org.apache.curator.test.compatibility.Zk35MethodInterceptor;
import org.apache.curator.utils.ZKPaths;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.concurrent.Semaphore;
@@ -43,6 +44,11 @@ public class TestPersistentTtlNode extends CuratorTestBase
private final Timing timing = new Timing();
private final long ttlMs = timing.multiple(.10).milliseconds(); // a small number
+ @BeforeClass
+ public static void setUpClass() {
+ System.setProperty("zookeeper.extendedTypesEnabled", "true");
+ }
+
@BeforeMethod
@Override
public void setup() throws Exception
[2/3] curator git commit: added a comment on change
Posted by ra...@apache.org.
added a comment on change
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/90a3e4c5
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/90a3e4c5
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/90a3e4c5
Branch: refs/heads/master
Commit: 90a3e4c57a61b8b669103dbc75d92a1810d1e392
Parents: b91036b
Author: randgalt <ra...@apache.org>
Authored: Sun Dec 2 10:03:31 2018 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Dec 2 10:03:31 2018 -0500
----------------------------------------------------------------------
curator-client/src/main/java/org/apache/curator/HandleHolder.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/90a3e4c5/curator-client/src/main/java/org/apache/curator/HandleHolder.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/HandleHolder.java b/curator-client/src/main/java/org/apache/curator/HandleHolder.java
index 0917d71..29c3962 100644
--- a/curator-client/src/main/java/org/apache/curator/HandleHolder.java
+++ b/curator-client/src/main/java/org/apache/curator/HandleHolder.java
@@ -157,7 +157,7 @@ class HandleHolder
zooKeeper.register(dummyWatcher); // clear the default watcher so that no new events get processed by mistake
if ( waitForShutdownTimeoutMs == 0 )
{
- zooKeeper.close();
+ zooKeeper.close(); // coming from closeAndReset() which is executed in ZK's event thread. Cannot use zooKeeper.close(n) otherwise we'd get a dead lock
}
else
{
[3/3] curator git commit: CURATOR-472 - Fixed unit test
Posted by ra...@apache.org.
CURATOR-472 - Fixed unit test
-Added setup of zookeeper.extednedTypesEnabled system property.
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/26ffdfb8
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/26ffdfb8
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/26ffdfb8
Branch: refs/heads/master
Commit: 26ffdfb89c685873b5592db29c541f92c22a06cd
Parents: 90a3e4c
Author: Cam McKenzie <ca...@apache.org>
Authored: Mon Dec 3 10:35:46 2018 +1100
Committer: Cam McKenzie <ca...@apache.org>
Committed: Mon Dec 3 10:35:46 2018 +1100
----------------------------------------------------------------------
.../java/org/apache/curator/framework/imps/TestTtlNodes.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/26ffdfb8/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java
index f253d96..e2156df 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTtlNodes.java
@@ -29,6 +29,7 @@ import org.apache.curator.test.compatibility.Zk35MethodInterceptor;
import org.apache.zookeeper.CreateMode;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.concurrent.CountDownLatch;
@@ -36,6 +37,11 @@ import java.util.concurrent.CountDownLatch;
@Test(groups = Zk35MethodInterceptor.zk35Group)
public class TestTtlNodes extends CuratorTestBase
{
+ @BeforeClass
+ public static void setUpClass() {
+ System.setProperty("zookeeper.extendedTypesEnabled", "true");
+ }
+
@BeforeMethod
@Override
public void setup() throws Exception