Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2814

Ignore space after comma in connection string

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.5.3
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            nikbhi15 Nikhil Bhide
            vilo Viliam Durina
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m