Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
4.0.1
-
None
-
None
-
win7 64, curator 4.0.1, zk 3.5
Description
I create an instance of GroupMember using GroupMember(CuratorFramework client, String membershipPath, String thisId) constructor, invoke GroupMember.start() method and GroupMember.setThisData() method
depending on timing of things I sometimes get
Exception in thread "main" java.lang.IllegalStateException: initial create has not been processed. Call waitForInitialCreate() to ensure.
at org.apache.curator.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:444)
at org.apache.curator.framework.recipes.nodes.PersistentNode.setData(PersistentNode.java:391)
at org.apache.curator.framework.recipes.nodes.GroupMember.setThisData(GroupMember.java:95)
I am sorry if I am missing something, but what API allows me to invoke pen.waitForInitialCreate or get some sort of a callback letting me know that I am allowed to change data?
There is a way to override newPersistentEphemeralNode() method in order to save pen reference and invoke waitForInitialCreate after GroupMember.start() but that does not seem right.
I am really sorry if I am missing the point of this recipe.