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:45:56 GMT


John Vines commented on CURATOR-34:

Well, based on our previous email discussion about possibly deprecating EnsurePath, this may
be something still worth investigating. Being able to do this type of check inline of the
create really helps streamline code, IMO.

I actually think there need to be 2 seperate flags though, ignoreIfExists and setDataIfExists
(or something along those lines). Personally, there are a flew blocks of code I have that
are basically
if checkExists==null

That I would LOVE to flatten to a single call.

> 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