[Dubbo-2191] add timeout config to zookeeper client#2217
[Dubbo-2191] add timeout config to zookeeper client#2217diecui1202 merged 1 commit intoapache:masterfrom htynkn:bug/fix-time-out-param-missing-in-reg
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2217 +/- ##
============================================
- Coverage 54.61% 54.58% -0.03%
+ Complexity 5152 5148 -4
============================================
Files 569 569
Lines 25031 25033 +2
Branches 4456 4456
============================================
- Hits 13671 13665 -6
- Misses 9320 9326 +6
- Partials 2040 2042 +2
Continue to review full report at Codecov.
|
| public ZkclientZookeeperClient(URL url) { | ||
| super(url); | ||
| client = new ZkClientWrapper(url.getBackupAddress(), 30000); | ||
| long timeout = url.getParameter("timeout", 30000L); |
There was a problem hiding this comment.
Maybe make 30000 to be a constant like org.apache.dubbo.common.Constants#DEFAULT_TIMEOUT is better ?
How do u think about it.
:)
There was a problem hiding this comment.
we have DEFAULT_TIMEOUT in Constants with value 1000, we also have DEFAULT_REGISTRY_CONNECT_TIMEOUT which has been commented out with value 5000.
Another thing is in ZkclientZookeeperClient.java timeout is 30000 but in CuratorZookeeperClient.java timeout is 5000.
so I prefer to keep those value in code and make sure existing user will not have unexpected behaviour when upgrade version
There was a problem hiding this comment.
请问为什么每次启动时都会报连接超时啊,但是能正常启动
| public ZkclientZookeeperClient(URL url) { | ||
| super(url); | ||
| client = new ZkClientWrapper(url.getBackupAddress(), 30000); | ||
| long timeout = url.getParameter("timeout", 30000L); |
There was a problem hiding this comment.
make sense. this one can replace by TIMEOUT_KEY
|
Also fix this issue: Remember to close this issue after merging this pr. |
|
It LGTM. |
|
hi, i am using the dependency is Look forward to your favourable reply. |
What is the purpose of the change
Add timeout config for zookeeper registry
Fix #2191
Close #1743
Brief changelog
Read timeout config from url and set to client
Verifying this change
CI pass
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests&mvn clean test-compile failsafe:integration-testto make sure unit-test and integration-test pass.