[ 
https://issues.apache.org/jira/browse/CURATOR-364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15750662#comment-15750662
 ] 

ASF GitHub Bot commented on CURATOR-364:
----------------------------------------

GitHub user IMS94 opened a pull request:

    https://github.com/apache/curator/pull/177

    [CURATOR-364] Persistent Node Constructor Requires a Started ZK Connection

    I have moved the 
    
    ```
    createMode= useProtection ? 
client.create().creatingParentContainersIfNeeded().withProtection() : 
client.create().creatingParentContainersIfNeeded();
    ```
    code segment to the **createNode()** method. Then, an exception will be 
raised only when you call the `start()` method of the PersistentNode without 
starting the client. This should be the expected behavior I guess?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/IMS94/curator CURATOR-364

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/177.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #177
    
----
commit a8a5d46cca4a6257d7f8edce9f3d21af3526847b
Author: Imesha <[email protected]>
Date:   2016-11-29T09:54:37Z

    Introduced hostname to InstanceSpec so that the TestingServer can be bound 
to other interfaces in a machine other than localhost (127.0.01)

commit 140342045e15876e610d5adee5eda5723d00f09d
Author: Imesha <[email protected]>
Date:   2016-12-13T02:54:00Z

    Merge branch 'master' of https://github.com/apache/curator

commit ea710f4ed62aed1a3a8f324280d1592a7c23b8e0
Author: Imesha <[email protected]>
Date:   2016-12-15T07:18:15Z

    CURATOR-364 - Moved createMode=client.create() segment to createNode() 
method

----


> Persistent Node Constructor Requires a Started ZK Connection
> ------------------------------------------------------------
>
>                 Key: CURATOR-364
>                 URL: https://issues.apache.org/jira/browse/CURATOR-364
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Recipes
>    Affects Versions: 2.11.1
>            Reporter: Ilya Biryukov
>
> *Steps to reproduce:*
> 1. Initialise an instance of PersistentNode
> 2. Ensure that CuratorFramework is Not Started (Latent)
> *Expected behaviour:*
> PersistentNode constructor should work without an active CuratorFramework 
> connection to ZK
> *Actual behaviour*:
> An Exception is thrown:
> {code}
> Caused by: java.lang.IllegalStateException: instance must be started before 
> calling this methodDEBUG [2016-12-14 10:25:25,641] akka.event.EventStream: 
> logger log1-Slf4jLogger started
>       at 
> com.google.common.base.Preconditions.checkState(Preconditions.java:150)
>       at 
> org.apache.curator.framework.imps.CuratorFrameworkImpl.create(CuratorFrameworkImpl.java:351)
>       at 
> org.apache.curator.framework.recipes.nodes.PersistentNode.<init>(PersistentNode.java:173)
> {code}
> *Thoughts*
> This behaviour is inconsistent with other Zk recepies based on Closable 
> interface. PersistentNode should not attempt any Zk communication until 
> start() method is called.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to