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

Takashi Ohnishi commented on ZOOKEEPER-1871:
--------------------------------------------

Hi.

> We are having some scripts to create/delete znodes through commandline. But 
> if getting the connection delays due to one of the node down, 
> then command will fail with connectionloss even though quorum is available.

We encountered the same situation. So, I want the proposed option, too!

I have attached a created patch for version 3.4.5.
This patch adds a option -waitforconnection to zkCli.sh and changes the usage 
of zkCli.sh as below.

{code}
   $ bin/zkCli.sh -server host:port -timeout sessionTimeout[ms] 
-waitforconnection waittimeout[ms] cmd args
{code}

zkCli.sh comes to wait for completion of connecting to a ZooKeeper server with 
the specified milliseconds timeout. 
Without the -waitforconnection option, zkCli.sh use a default value 30,000 
millisecond. 

> Add an option to zkCli to wait for connection before executing commands
> -----------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1871
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1871
>             Project: ZooKeeper
>          Issue Type: Improvement
>            Reporter: Vinayakumar B
>
> Add an option to zkCli to wait for connection before executing any commands.
> This is helpful for the execution of inline commands.
> We are having some scripts to create/delete znodes through commandline. But 
> if getting the connection delays due to one of the node down, then command 
> will fail with connectionloss even though quorum is available.
> So I propose a commandline option (similar to -server and -timeout) 
> "-waitforconnection" to wait for the connection before executing any commands.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to