Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZOOKEEPER-1871: Add an option to zkCli to wait for connection before executing commands #1621

Closed
wants to merge 2 commits into from

Conversation

MuktiKrishnan
Copy link
Contributor

@MuktiKrishnan MuktiKrishnan commented Mar 4, 2021

-waitforconnection option will make zk client wait for -timeout time to connect to zk server. timeout time is 30ms by default but can be specified explicitly using -timeout option.

@MuktiKrishnan MuktiKrishnan changed the title ZOOKEEPER-1871: Add an option to zkCli to wailt for connection before… ZOOKEEPER-1871: Add an option to zkCli to wait for connection before… Mar 5, 2021
String[] args1 = {"-server", "localhost:" + invalid_port, "-timeout",
Long.toString(timeout), "-waitforconnection", "ls", "/"};
long start_time = System.currentTimeMillis();
// try to connect to a non-existing server so as to wait until wait_timeout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using CamelCase naming style(e.g.: startTime) in the UT

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used CamelCase naming style. Thanks @maoling for pointing out

}
int timeout = Integer.parseInt(cl.getOption("timeout"));
zk = new ZooKeeperAdmin(host, timeout, new MyWatcher(),readOnly);
if (connectLatch != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add more clarifications about the difference between waitforconnection and timeout in the GitHub description?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have given some clarification on waitforconnection and timeout options in GitHub description. Thanks

@arshadmohammad
Copy link
Contributor

@MuktiKrishnan please raise PR on master first

@MuktiKrishnan MuktiKrishnan changed the title ZOOKEEPER-1871: Add an option to zkCli to wait for connection before… ZOOKEEPER-1871: Add an option to zkCli to wait for connection before executing commands Mar 9, 2021
@MuktiKrishnan
Copy link
Contributor Author

@MuktiKrishnan please raise PR on master first

I have raised PR on master branch.

@arshadmohammad
Copy link
Contributor

These changes are being merged from #1626 PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants