-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZOOKEEPER-3878: Client connection fails if IPV6 is not enclosed in square brackets #1398
Conversation
host = hostAndPort[0]; | ||
if (hostAndPort.length == 2) { | ||
port = Integer.parseInt(hostAndPort[1]); | ||
} | ||
} catch (ConfigException e) { | ||
e.printStackTrace(); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this part of the logic is not inside
NetUtils.getIPV6HostAndPort(host) ?
What about pushing it up there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to make getIPV6HostAndPort API more generic so it can be used other places as well for example it can be used to input of host:port:port and [host]:port:port as well. If we move above said logic to getIPV6HostAndPort host:port:port will give wrong result; So I wanted to keep only common logic in getIPV6HostAndPort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to me
host = hostAndPort[0]; | ||
if (hostAndPort.length == 2) { | ||
port = Integer.parseInt(hostAndPort[1]); | ||
} | ||
} catch (ConfigException e) { | ||
e.printStackTrace(); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to me
…uare brackets Author: Mohammad Arshad 72626 <mohammad.arshad@huawei.com> Reviewers: Enrico Olivelli <eolivelli@apache.org> Closes #1398 from arshadmohammad/ZOOKEEPER-3878-master (cherry picked from commit f362313) Signed-off-by: Enrico Olivelli <eolivelli@apache.org>
I have cherry-picked this patch to branch-3.6. IMO we can just pick it to 3.6, hopefully we will cut a new release soon on 3.6.x |
This scenario is not a bug in branch-3.5. It is an improvement there. But I think it is good to be in sync. |
…uare brackets Author: Mohammad Arshad 72626 <mohammad.arshad@huawei.com> Reviewers: Enrico Olivelli <eolivelli@apache.org> Closes apache#1398 from arshadmohammad/ZOOKEEPER-3878-master
…uare brackets Author: Mohammad Arshad 72626 <mohammad.arshad@huawei.com> Reviewers: Enrico Olivelli <eolivelli@apache.org> Closes apache#1398 from arshadmohammad/ZOOKEEPER-3878-master
…uare brackets Author: Mohammad Arshad 72626 <mohammad.arshad@huawei.com> Reviewers: Enrico Olivelli <eolivelli@apache.org> Closes apache#1398 from arshadmohammad/ZOOKEEPER-3878-master
…uare brackets Author: Mohammad Arshad 72626 <mohammad.arshad@huawei.com> Reviewers: Enrico Olivelli <eolivelli@apache.org> Closes apache#1398 from arshadmohammad/ZOOKEEPER-3878-master
…uare brackets Author: Mohammad Arshad 72626 <mohammad.arshad@huawei.com> Reviewers: Enrico Olivelli <eolivelli@apache.org> Closes apache#1398 from arshadmohammad/ZOOKEEPER-3878-master
No description provided.