ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-677

c client doesn't allow ipv6 numeric connect string

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.2.2
    • Fix Version/s: 3.3.0
    • Component/s: c client
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Tags:
      ipv6

      Description

      The c client doesn't handle ipv6 numeric addresses as they are colon : delmited. After splitting the host/port on : we look for the port as the second entry in the array rather than the last entry in the array.

      1. ZOOKEEPER-677.patch
        2 kB
        Benjamin Reed
      2. ZOOKEEPER-677.patch
        3 kB
        Mahadev konar
      3. ZOOKEEPER-677.patch
        4 kB
        Mahadev konar
      4. ZOOKEEPER-677.patch
        5 kB
        Mahadev konar
      5. ZOOKEEPER-677.patch
        5 kB
        Patrick Hunt

        Issue Links

          Activity

          Hide
          Hudson added a comment -

          Integrated in ZooKeeper-trunk #732 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/732/)
          . c client doesn't allow ipv6 numeric connect string

          Show
          Hudson added a comment - Integrated in ZooKeeper-trunk #732 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/732/ ) . c client doesn't allow ipv6 numeric connect string
          Hide
          Benjamin Reed added a comment -

          Committed revision 921439.

          Show
          Benjamin Reed added a comment - Committed revision 921439.
          Hide
          Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12438242/ZOOKEEPER-677.patch
          against trunk revision 921201.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 6 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/8/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/8/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/8/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12438242/ZOOKEEPER-677.patch against trunk revision 921201. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 6 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/8/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/8/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/8/console This message is automatically generated.
          Hide
          Benjamin Reed added a comment -

          +1 looks good

          Show
          Benjamin Reed added a comment - +1 looks good
          Hide
          Mahadev konar added a comment -

          retrying hudson.

          Show
          Mahadev konar added a comment - retrying hudson.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12438240/ZOOKEEPER-677.patch
          against trunk revision 919706.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 6 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/2/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/2/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/2/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12438240/ZOOKEEPER-677.patch against trunk revision 919706. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 6 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/2/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/2/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/2/console This message is automatically generated.
          Hide
          Patrick Hunt added a comment -

          Fixed a problem on my machine (ubuntu karmic) - missing EAI_NODATA check.

          Show
          Patrick Hunt added a comment - Fixed a problem on my machine (ubuntu karmic) - missing EAI_NODATA check.
          Hide
          Mahadev konar added a comment -

          this patch adds a gcc parameter so that all the return codes of getaddrinfo are defined. the tests pass on the hudson machine now.

          Show
          Mahadev konar added a comment - this patch adds a gcc parameter so that all the return codes of getaddrinfo are defined. the tests pass on the hudson machine now.
          Hide
          Mahadev konar added a comment -

          the earlier patch doesnt compile on hudson machine and needs specific include for netdb,h header file.

          Show
          Mahadev konar added a comment - the earlier patch doesnt compile on hudson machine and needs specific include for netdb,h header file.
          Hide
          Mahadev konar added a comment -

          the issue is problem with getaddrinfo implementaiton on the hudson machine. According to the spec getaddrinfo should work on a ipv6 host with ai_flags=AI_ADDRCONFIG and ai_family=AF_UNSPEC, but looks like it returns EAI_ADDRFAMILY.

          I put in a retry with ai_flags=0 in case of the above errors. It seems like its a good optimization to use AI_ADDRCONFIG for AF_UNSPEC

          http://www.ops.ietf.org/lists/v6ops/v6ops.2003/msg01377.html, so a retry should make it work in case of such faulty implementations of getaddrinfo.

          Show
          Mahadev konar added a comment - the issue is problem with getaddrinfo implementaiton on the hudson machine. According to the spec getaddrinfo should work on a ipv6 host with ai_flags=AI_ADDRCONFIG and ai_family=AF_UNSPEC, but looks like it returns EAI_ADDRFAMILY. I put in a retry with ai_flags=0 in case of the above errors. It seems like its a good optimization to use AI_ADDRCONFIG for AF_UNSPEC http://www.ops.ietf.org/lists/v6ops/v6ops.2003/msg01377.html , so a retry should make it work in case of such faulty implementations of getaddrinfo.
          Hide
          Patrick Hunt added a comment -

          cancelling patch, hudson fails with:

          [exec] [exec] Zookeeper_simpleSystem::testIPV6 : assertion : elapsed 1000

          ....

          [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h8.grid.sp2.yahoo.net/trunk/src/c/tests/TestClient.cc:582: Assertion: assertion failed [Expression: zk]
          [exec] [exec] Failures !!!
          [exec] [exec] Run: 44 Failure total: 1 Failures: 1 Errors: 0
          [exec] [exec] make: *** [run-check] Error 1

          Show
          Patrick Hunt added a comment - cancelling patch, hudson fails with: [exec] [exec] Zookeeper_simpleSystem::testIPV6 : assertion : elapsed 1000 .... [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h8.grid.sp2.yahoo.net/trunk/src/c/tests/TestClient.cc:582: Assertion: assertion failed [Expression: zk] [exec] [exec] Failures !!! [exec] [exec] Run: 44 Failure total: 1 Failures: 1 Errors: 0 [exec] [exec] make: *** [run-check] Error 1
          Hide
          Benjamin Reed added a comment -

          looks good mahadev. thanx for fixing. one problem:

          LOG_ERROR(("getaddrinfo: %s\n", strerror(errno)));
          + errno = getaddrinfo_errno(rc);

          should be

          + errno = getaddrinfo_errno(rc);
          LOG_ERROR(("getaddrinfo: %s\n", strerror(errno)));

          any idea why the test is failing?

          Show
          Benjamin Reed added a comment - looks good mahadev. thanx for fixing. one problem: LOG_ERROR(("getaddrinfo: %s\n", strerror(errno))); + errno = getaddrinfo_errno(rc); should be + errno = getaddrinfo_errno(rc); LOG_ERROR(("getaddrinfo: %s\n", strerror(errno))); any idea why the test is failing?
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12438065/ZOOKEEPER-677.patch
          against trunk revision 919640.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 6 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/134/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/134/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/134/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12438065/ZOOKEEPER-677.patch against trunk revision 919640. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 6 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/134/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/134/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/134/console This message is automatically generated.
          Hide
          Mahadev konar added a comment -

          this patch should fix the issue.

          Show
          Mahadev konar added a comment - this patch should fix the issue.
          Hide
          Mahadev konar added a comment -

          cancelling the patch... looks like getaddrinfo() does not set the errno value. So, we will have to set it manually in case of error conditions from getaddrinfo()

          Show
          Mahadev konar added a comment - cancelling the patch... looks like getaddrinfo() does not set the errno value. So, we will have to set it manually in case of error conditions from getaddrinfo()
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12436677/ZOOKEEPER-677.patch
          against trunk revision 912119.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 6 new or modified tests.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/122/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/122/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/122/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12436677/ZOOKEEPER-677.patch against trunk revision 912119. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 6 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/122/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/122/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/122/console This message is automatically generated.
          Hide
          Benjamin Reed added a comment -

          this patch finds the port using strrchr instead of strchr to allow ipv6 addresses. the test case assumes that localhost is reachable with ::1

          Show
          Benjamin Reed added a comment - this patch finds the port using strrchr instead of strchr to allow ipv6 addresses. the test case assumes that localhost is reachable with ::1

            People

            • Assignee:
              Mahadev konar
              Reporter:
              Patrick Hunt
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development