-
Notifications
You must be signed in to change notification settings - Fork 387
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
Reduce timeout for the first Connect() request #540
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thank you for your PR.
I am not sure if this is the best way to handle this case... KazooClient is accepting a timeout
parameter, isn't it better to personnalize that parameter? I might be missing something... why the value of len(client.hosts)
?
Hi, This was defined in a similar manner as |
You are right, this makes sense. It is also available in the java client (https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java#L1383). Can you please amend your commit in order to follow the CONTRIBUTING.md guidelines? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please amend your commit.
In the case of a zookeeper server under pressure, it will typically try to maintain the quorum rather than handling client requests. In this kind of case, the quorum is maintained, the connection works, but the client is frozen there. Retrying after a shorter timeout means we can reconnect to another server before losing the session altogether.
@StephenSorriaux does it look good now? |
@ralt That is great! Thanks again for your PR. |
Thanks for the merge! 👍 |
In the case of a zookeeper server under pressure, it will typically try to maintain the quorum rather than handling client requests. In this kind of case, the quorum is maintained, the connection works, but the client is frozen there.
Retrying after a shorter timeout means we can reconnect to another server before losing the session altogether.