ZOOKEEPER-1871: Add an option to zkCli to wait for connection before executing commands#1621
Closed
MuktiKrishnan wants to merge 2 commits intoapache:branch-3.6from
Closed
ZOOKEEPER-1871: Add an option to zkCli to wait for connection before executing commands#1621MuktiKrishnan wants to merge 2 commits intoapache:branch-3.6from
MuktiKrishnan wants to merge 2 commits intoapache:branch-3.6from
Conversation
… executing commands
maoling
reviewed
Mar 8, 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 |
Member
There was a problem hiding this comment.
using CamelCase naming style(e.g.: startTime) in the UT
Contributor
Author
There was a problem hiding this comment.
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) { |
Member
There was a problem hiding this comment.
Could you please add more clarifications about the difference between waitforconnection and timeout in the GitHub description?
Contributor
Author
There was a problem hiding this comment.
I have given some clarification on waitforconnection and timeout options in GitHub description. Thanks
Contributor
|
@MuktiKrishnan please raise PR on master first |
Contributor
Author
I have raised PR on master branch. |
Contributor
|
These changes are being merged from #1626 PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-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.