curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Vines (JIRA)" <>
Subject [jira] [Commented] (CURATOR-34) CuratorFramework.create().creatingParentsIfNeeded().forPath() throws NodeExistsException if node exists
Date Tue, 17 Sep 2013 15:55:51 GMT


John Vines commented on CURATOR-34:

Well, in the create() chain, I see two different scenarios based on the node already existing.

Either you want have the final forPath()'s arguments set or not set, and that's where I see
the need for two different flags. Basically, if the node you're trying to create exists, then
ignore this call OR setData. Honestly, where I sorta see this discussion going is blurring
the line between create() and setData() to sort of flatten them into a single family with
some different behaviors depending on existence.

ignoreIfExists is equivalent to ifNotExists. A boolean is nice, but I can see that worked
around in client code if people need feedback since I imagine that sort of change isn't quite
feasible. I mean, they could just not use that method and catch the exception if they're trying
to figure that sort of thing out.
> CuratorFramework.create().creatingParentsIfNeeded().forPath() throws NodeExistsException
if node exists
> -------------------------------------------------------------------------------------------------------
>                 Key: CURATOR-34
>                 URL:
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 2.0.0-incubating, 2.0.1-incubating
>            Reporter: Nandor Kracser
>            Priority: Minor
> I think that NodeExistsException should be ignored in CreateBuilderImpl. In the try and
in the NoNodeException catch block as well.
> org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists
for /examples/something
> 	at org.apache.zookeeper.KeeperException.create(
> 	at org.apache.zookeeper.KeeperException.create(
> 	at org.apache.zookeeper.ZooKeeper.create(
> 	at org.apache.curator.framework.imps.CreateBuilderImpl$
> 	at org.apache.curator.framework.imps.CreateBuilderImpl$
> 	at org.apache.curator.RetryLoop.callWithRetry(
> 	at org.apache.curator.framework.imps.CreateBuilderImpl.pathInForeground(
> 	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(
> 	at org.apache.curator.framework.imps.CreateBuilderImpl.forPath(
> 	at org.apache.curator.framework.imps.CreateBuilderImpl$4.forPath(
> 	at org.apache.curator.framework.imps.CreateBuilderImpl$4.forPath(

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message