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/10/12 18:14: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=16202374#comment-16202374 ] 

ASF GitHub Bot commented on ZOOKEEPER-2814:
-------------------------------------------

Github user mfenes commented on the issue:

    https://github.com/apache/zookeeper/pull/371
  
    Regex implementation would be shorter to ignore the spaces and empty strings as
    ```
    connectString.replaceAll("\\s", "").replaceAll(",+", ",").split(",") 
    ```
    does the same thing as the new StringUtils.split(String value, String separator) implementation in this PR.


> 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 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)