You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/07/11 11:28:15 UTC
[GitHub] [zookeeper] arshadmohammad opened a new pull request #1398: ZOOKEEPER-3878: Client connection fails if IPV6 is not enclosed in sq…
arshadmohammad opened a new pull request #1398:
URL: https://github.com/apache/zookeeper/pull/1398
…uare brackets
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] arshadmohammad commented on pull request #1398: ZOOKEEPER-3878: Client connection fails if IPV6 is not enclosed in square brackets
Posted by GitBox <gi...@apache.org>.
arshadmohammad commented on pull request #1398:
URL: https://github.com/apache/zookeeper/pull/1398#issuecomment-657765306
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.
Have create jira https://issues.apache.org/jira/browse/ZOOKEEPER-3886 and raised PR https://github.com/apache/zookeeper/pull/1400
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] eolivelli closed pull request #1398: ZOOKEEPER-3878: Client connection fails if IPV6 is not enclosed in square brackets
Posted by GitBox <gi...@apache.org>.
eolivelli closed pull request #1398:
URL: https://github.com/apache/zookeeper/pull/1398
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] eolivelli commented on pull request #1398: ZOOKEEPER-3878: Client connection fails if IPV6 is not enclosed in square brackets
Posted by GitBox <gi...@apache.org>.
eolivelli commented on pull request #1398:
URL: https://github.com/apache/zookeeper/pull/1398#issuecomment-657467244
I have cherry-picked this patch to branch-3.6.
It does not cherry-pick to branch-3.5
if you are interested in picking it to that release branch then please send another PR
IMO we can just pick it to 3.6, hopefully we will cut a new release soon on 3.6.x
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] eolivelli commented on a change in pull request #1398: ZOOKEEPER-3878: Client connection fails if IPV6 is not enclosed in sq…
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #1398:
URL: https://github.com/apache/zookeeper/pull/1398#discussion_r453540924
##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/client/ConnectStringParser.java
##########
@@ -70,16 +69,22 @@ public ConnectStringParser(String connectString) {
List<String> hostsList = split(connectString, ",");
for (String host : hostsList) {
int port = DEFAULT_PORT;
- try {
- String[] hostAndPort = ConfigUtils.getHostAndPort(host);
+ String[] hostAndPort = NetUtils.getIPV6HostAndPort(host);
+ if (hostAndPort.length != 0) {
host = hostAndPort[0];
if (hostAndPort.length == 2) {
port = Integer.parseInt(hostAndPort[1]);
}
- } catch (ConfigException e) {
- e.printStackTrace();
+ } else {
Review comment:
makes sense to me
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] arshadmohammad commented on a change in pull request #1398: ZOOKEEPER-3878: Client connection fails if IPV6 is not enclosed in sq…
Posted by GitBox <gi...@apache.org>.
arshadmohammad commented on a change in pull request #1398:
URL: https://github.com/apache/zookeeper/pull/1398#discussion_r453360716
##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/client/ConnectStringParser.java
##########
@@ -70,16 +69,22 @@ public ConnectStringParser(String connectString) {
List<String> hostsList = split(connectString, ",");
for (String host : hostsList) {
int port = DEFAULT_PORT;
- try {
- String[] hostAndPort = ConfigUtils.getHostAndPort(host);
+ String[] hostAndPort = NetUtils.getIPV6HostAndPort(host);
+ if (hostAndPort.length != 0) {
host = hostAndPort[0];
if (hostAndPort.length == 2) {
port = Integer.parseInt(hostAndPort[1]);
}
- } catch (ConfigException e) {
- e.printStackTrace();
+ } else {
Review comment:
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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] eolivelli commented on a change in pull request #1398: ZOOKEEPER-3878: Client connection fails if IPV6 is not enclosed in sq…
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #1398:
URL: https://github.com/apache/zookeeper/pull/1398#discussion_r453213174
##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/client/ConnectStringParser.java
##########
@@ -70,16 +69,22 @@ public ConnectStringParser(String connectString) {
List<String> hostsList = split(connectString, ",");
for (String host : hostsList) {
int port = DEFAULT_PORT;
- try {
- String[] hostAndPort = ConfigUtils.getHostAndPort(host);
+ String[] hostAndPort = NetUtils.getIPV6HostAndPort(host);
+ if (hostAndPort.length != 0) {
host = hostAndPort[0];
if (hostAndPort.length == 2) {
port = Integer.parseInt(hostAndPort[1]);
}
- } catch (ConfigException e) {
- e.printStackTrace();
+ } else {
Review comment:
Why this part of the logic is not inside
NetUtils.getIPV6HostAndPort(host) ?
What about pushing it up there?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org