Repository navigation
Conversation
kezhuw
reviewed
Oct 22, 2026
kezhuw
left a comment
Member
There was a problem hiding this comment.
I think the problem resides in constructor of ZooKeeper. We should give clientConfig a no null ZKClientConfig there to not misuse it. But the change is good anyway.
zookeeper/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java
Lines 1139 to 1147 in 777b372
kezhuw
approved these changes
Oct 26, 2026
anmolnar
approved these changes
Oct 26, 2026
anmolnar
left a comment
Contributor
There was a problem hiding this comment.
lgtm. Please address remaining comment.
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.
DnsSrvHostProviderreceives the client'sZKClientConfig, andZKClientConfigcopieszookeeper.hostProvider.dnsSrvRefreshIntervalSecondsfrom the system properties like the other client settings, but the refresh interval was read withLong.getLong(). A value set in a client config file or withZKClientConfig.setProperty()was ignored, so the provider kept refreshing every 60 seconds (or used whatever the system property said).The interval is now read from the given
ZKClientConfig, falling back to a newZKClientConfigwhen none is passed, the same wayHostConnectionManagerdoes. The system property keeps working becauseZKClientConfigis initialized from it.Behaviour changes, both limited to this new 3.10.0 provider:
NumberFormatException, consistent with how a negative value is rejected and howzookeeper.request.timeoutis handled.Testing
DnsSrvHostProviderTest#testRefreshIntervalFromClientConfig(interval1inZKClientConfig, expects a periodic lookup) and#testRefreshIntervalNegativeInClientConfig(-1inZKClientConfigis rejected) fail without the fix and pass with it. The existing system property tests still pass.org.apache.zookeeper.client.*Test,HostProviderSelectionTest,StaticHostProviderTest,ConnectStringParserTestandCustomHostProviderTestpass; checkstyle and spotbugs report no issues.new ZooKeeper("dns-srv://...", ..., new ZKClientConfig(configFile)), where the file sets the interval to 1, sent 1 SRV query during a 3.5 second session before the fix and 4 (one per second) after it.