Rhys Yarranton created CURATOR-381:
--------------------------------------
Summary: PersistentNode.start() fails if CuratorFramework unable
to connect, when using namespace
Key: CURATOR-381
URL: https://issues.apache.org/jira/browse/CURATOR-381
Project: Apache Curator
Issue Type: Bug
Components: Framework
Affects Versions: 3.2.1
Environment: Zookeeper 3.5.2-alpha
Reporter: Rhys Yarranton
Encountered the following exception
{noformat}
2017-01-27 17:41:49.515 ERROR
[org.apache.curator.framework.imps.CuratorFrameworkImpl] {main} Ensure path
threw exception
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode =
ConnectionLoss for /bids
at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1846)
at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1874)
at org.apache.curator.utils.ZKPaths.mkdirs(ZKPaths.java:274)
at
org.apache.curator.framework.imps.NamespaceImpl$1.call(NamespaceImpl.java:90)
at
org.apache.curator.connection.StandardConnectionHandlingPolicy.callWithRetry(StandardConnectionHandlingPolicy.java:67)
at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:100)
at
org.apache.curator.framework.imps.NamespaceImpl.fixForNamespace(NamespaceImpl.java:83)
at
org.apache.curator.framework.imps.CuratorFrameworkImpl.fixForNamespace(CuratorFrameworkImpl.java:695)
at
org.apache.curator.framework.imps.WatcherRemovalFacade.fixForNamespace(WatcherRemovalFacade.java:176)
at
org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:488)
at
org.apache.curator.framework.imps.CreateBuilderImpl.forPath(CreateBuilderImpl.java:44)
at
org.apache.curator.framework.recipes.nodes.PersistentNode.createNode(PersistentNode.java:414)
at
org.apache.curator.framework.recipes.nodes.PersistentNode.start(PersistentNode.java:276)
....
{noformat}
For context, the calling code started a CuratorFramework, and then started a
PersistentNode. There was no quorum of servers available at that time.
>From the PersistentNode code, you would expect start() to operate in the
>background. However, the step NamespaceImpl.fixForNamespace is in the
>foreground. In addition to fixing up the path, this method also does an
>ensure if required, in a retry loop.
The retry loop eventually terminated w/ the above error, apparently because the
CuratorFramework decided it wasn't going to be able to connect any time soon.
(And until that point the PersistentNode.start() call would not have returned.)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)