-
Notifications
You must be signed in to change notification settings - Fork 9k
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
HADOOP-19469. Set Curator Connection Timeout. #7426
base: trunk
Are you sure you want to change the base?
Conversation
Curator 5.2.0 has a default "connection timeout" of 15s: https://github.com/apache/curator/blob/apache-curator-5.2.0/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java#L63 And it will throw a warning if the Zookeeper session timeout is less than the Curator connection timeout: https://github.com/apache/curator/blob/apache-curator-5.2.0/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java#L117-L120 The Hadoop default for ZK timeout is set to 10s: https://github.com/apache/hadoop/blob/0dd9bf8/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeys.java#L414-L416 Which means without setting the "connection timeout" a default installation will keep warning about the connection timeout for Curator is lower than the requested session timeout. This sets both timeout values to override the Curator default. Another option is to change the default Hadoop ZK timeout from 10s to 15s.
💔 -1 overall
This message was automatically generated. |
@xyu Thanks for the contribution! LGTM. I think setting the timeout parameters this way is acceptable. |
Thanks @xyu . How about add another single configure item about connection timeout here? Actually for zookeeper, the connection timeout is calculated by |
Sure we can do that, what do you think about
Yeah I guess this is true, ZK will negotiate a timeout with the client based on it's allowed max/min range on the server and what the client requests. So I guess in theory someone could say set a 60s timeout for a default ZK install and end up getting capped at 40s (20 ticks * 2000ms per tick). That setting would effectively set Curator connection timeout to 60s on top of a ZK connection timeout of 40s. (Similar to how we currently default to 15s Curator connection timeout on top of a 10s timeout ZK connection.) I'm actually not sure what the failure scenario looks like for these Curator "connection timeout" being longer than the underlying connection. I see that Curator warns about it but I don't have an in depth understanding of what happens with Curator when configured this way. @Hexiaoqiao what do you think is the best way to resolve this? Should we just warn users in docs that Curator connection timeout needs to be lower than ZK session timeout and that the session timeout is negotiated? Something else? |
Thanks @xyu for your detailed comments.
+1.
Strong +1 from my side. Now the config items is so many to confuse end user. I have no idea to improve that currently. Back to this PR, I think expose ZK/Curator config is proper based on the current status because we could not manage ZK/Curator logic in Hadoop community, so leave the choice to end user maybe one reasonable tradeoff. About the default value, I prefer change the default Hadoop ZK timeout from 10s to 15s and give Thanks again. |
JIRA: HADOOP-19469. Set Curator Connection Timeout.
Curator 5.2.0 has a default "connection timeout" of 15s:
https://github.com/apache/curator/blob/apache-curator-5.2.0/curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java#L63
And it will throw a warning if the Zookeeper session timeout is less than the Curator connection timeout:
https://github.com/apache/curator/blob/apache-curator-5.2.0/curator-client/src/main/java/org/apache/curator/CuratorZookeeperClient.java#L117-L120
The Hadoop default for ZK timeout is set to 10s:
https://github.com/apache/hadoop/blob/0dd9bf8/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeys.java#L414-L416
Which means without setting the "connection timeout" a default installation will keep warning about the connection timeout for Curator being lower than the requested session timeout. This sets both timeout values to override the Curator default.
Another option is to change the default Hadoop ZK timeout from 10s to 15s.
Description of PR
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?