You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/11 13:31:00 UTC
[jira] [Commented] (ZOOKEEPER-2814) Ignore space after comma in
connection string
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16161238#comment-16161238 ]
ASF GitHub Bot commented on ZOOKEEPER-2814:
-------------------------------------------
GitHub user nikhilbhide opened a pull request:
https://github.com/apache/zookeeper/pull/368
ZOOKEEPER-2814: Ignore space after comma in connection string
Ported ZOOKEEPER-2814 from master to branch 3.4.
Added files
src/java/main/org/apache/zookeeper/common/StringUtils.java
src/java/test/org/apache/zookeeper/test/StringUtilTest.java
Modified Files:
src/java/main/org/apache/zookeeper/client/ConnectStringParser.java
src/java/test/org/apache/zookeeper/test/ConnectStringParserTest.java
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nikhilbhide/zookeeper ZOOKEEPER-2814
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zookeeper/pull/368.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #368
----
commit 11da57df94c95b52a97b7c039e1ba042ebac8ed7
Author: Nikhil Bhide <ni...@gmail.com>
Date: 2017-09-11T13:14:29Z
ZOOKEEPER-2814: Ignore space after comma in connection string
Added logic to trim host connection string for ZOOKEEPER-2814: Ignore space after comma in connection string
Port ZOOKEEPER-2814 from master
commit 3f210394e989507282d1e42fb9f3e35512d314e8
Author: Nikhil Bhide <ni...@gmail.com>
Date: 2017-09-11T13:19:44Z
Zookeeper 2814: ignore space after comma in connection string
Port Zookeeper 2814 from master to branch - 3.4
Created StringUtils.java
commit 7da1c0786f7ca7aabe73f53f818db97d82e701e1
Author: Nikhil Bhide <ni...@gmail.com>
Date: 2017-09-11T13:22:26Z
ZOOKEEPER-2814: Ignore space after comma in connection string
Port ZOOKEEPER-2814 from master to branch-3.4
Added code to test split logic implemented in StringUtils.java
commit 1629f64f58c7787bb993162e5c9b8565b4d45c64
Author: Nikhil Bhide <ni...@gmail.com>
Date: 2017-09-11T13:26:08Z
ZOOKEEPER-2814: Ignore space after comma in connection string
Port ZOOKEEPER-2814 from master to branch-3.4
Added test to verify the logic added to remove the spaces provided in connection string
----
> Ignore space after comma in connection string
> ---------------------------------------------
>
> Key: ZOOKEEPER-2814
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2814
> Project: ZooKeeper
> Issue Type: Bug
> Affects Versions: 3.5.3
> Reporter: Viliam Durina
> Assignee: Nikhil Ashok Bhide
> Priority: Minor
>
> I'm using the following connection string:
> {{10.0.0.179:2181,<space>10.0.0.176:2181}}
> However, I get:
> {{java.net.UnknownHostException: 10.0.0.176: Name or service not known
> at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
> at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
> at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
> at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
> at java.net.InetAddress.getAllByName(InetAddress.java:1192)
> at java.net.InetAddress.getAllByName(InetAddress.java:1126)
> at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:61)
> at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445)
> at ...
> ...}}
> The problem was the space after the comma. I suggest to either make the space optional or produce error on it, as this is a real pain to spot. Using the space also makes the connect string more readable. Spaces are not allowed in domain names.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)