Repository: curator
Updated Branches:
refs/heads/CURATOR-498 [created] 31151b67b
CURATOR-498
"Protection" has a potential bug. If the connection is lost for long enough,
Curator will want to kill the session. Session deletions must be handled by the
Leader ZK instance. At the same time that the session kill is being processed,
Curator's protection mode handling could be calling the follower that it's
connected to get the current list of children - this can be handled directly by
the follower instance without needing to call the leader. So, in this scenario,
the client will get a list of children that includes the ZNode that will get
deleted as part of killing the session.
This bug has been in Curator since we added the protection feature to it more
than 6 years ago. The only feasible fix is to set a watcher on the found ZNode
so that clients can be notified if the ZNode is deleted (or no longer exists).
This requires changes to any client unfortunately. All Curator recipes will be
updated by existing Curator client code will need to be updated
manually.
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/31151b67
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/31151b67
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/31151b67
Branch: refs/heads/CURATOR-498
Commit: 31151b67b2b704d7a31579284168d3f034694fed
Parents: 219c881
Author: randgalt
Authored: Wed Jan 2 17:53:11 2019 -0500
Committer: randgalt
Committed: Wed Jan 2 17:53:11 2019 -0500
--
.../framework/api/CreateBuilderMain.java| 2 +
...ateProtectACLCreateModePathAndBytesable.java | 2 +
.../ProtectACLCreateModePathAndBytesable.java | 2 +
.../framework/imps/CreateBuilderImpl.java | 72 +++--
.../framework/state/ConnectionStateManager.java | 6 +-
.../framework/imps/TestFrameworkEdges.java | 84 +++-
.../framework/recipes/leader/LeaderLatch.java | 19 -
7 files changed, 177 insertions(+), 10 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/curator/blob/31151b67/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilderMain.java
--
diff --git
a/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilderMain.java
b/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilderMain.java
index 3d076b2..c6d480a 100644
---
a/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilderMain.java
+++
b/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilderMain.java
@@ -83,4 +83,6 @@ public interface CreateBuilderMain extends
* @return this
*/
public ACLCreateModeStatBackgroundPathAndBytesable
withProtection();
+
+public Watchable>
withWatchedProtection();
}
http://git-wip-us.apache.org/repos/asf/curator/blob/31151b67/curator-framework/src/main/java/org/apache/curator/framework/api/CreateProtectACLCreateModePathAndBytesable.java
--
diff --git
a/curator-framework/src/main/java/org/apache/curator/framework/api/CreateProtectACLCreateModePathAndBytesable.java
b/curator-framework/src/main/java/org/apache/curator/framework/api/CreateProtectACLCreateModePathAndBytesable.java
index 9e0c840..0d6f35b 100755
---
a/curator-framework/src/main/java/org/apache/curator/framework/api/CreateProtectACLCreateModePathAndBytesable.java
+++
b/curator-framework/src/main/java/org/apache/curator/framework/api/CreateProtectACLCreateModePathAndBytesable.java
@@ -69,4 +69,6 @@ public interface
CreateProtectACLCreateModePathAndBytesable extends
* @return this
*/
public ACLCreateModeBackgroundPathAndBytesablewithProtection();
+
+public Watchable>
withWatchedProtection();
}
http://git-wip-us.apache.org/repos/asf/curator/blob/31151b67/curator-framework/src/main/java/org/apache/curator/framework/api/ProtectACLCreateModePathAndBytesable.java
--
diff --git
a/curator-framework/src/main/java/org/apache/curator/framework/api/ProtectACLCreateModePathAndBytesable.java
b/curator-framework/src/main/java/org/apache/curator/framework/api/ProtectACLCreateModePathAndBytesable.java
index 1d1df10..57f4beb 100644
---
a/curator-framework/src/main/java/org/apache/curator/framework/api/ProtectACLCreateModePathAndBytesable.java
+++
b/curator-framework/src/main/java/org/apache/curator/framework/api/ProtectACLCreateModePathAndBytesable.java
@@ -51,4 +51,6 @@ public interface ProtectACLCreateModePathAndBytesable
extends
* @return this
*/
public ACLCreateModeBackgroundPathAndBytesablewithProtection();
+
+public