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

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Patch Available Patch Available Open Open
          13d 19h 4m 7 Benjamin Reed 10/Mar/10 05:33
          Open Open Patch Available Patch Available
          1d 16h 9m 8 Benjamin Reed 10/Mar/10 05:33
          Patch Available Patch Available Resolved Resolved
          11h 1 Benjamin Reed 10/Mar/10 16:34
          Resolved Resolved Closed Closed
          16d 51m 1 Patrick Hunt 26/Mar/10 17:25
          Patrick Hunt made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Patrick Hunt made changes -
          Tags ipv6
          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
          Benjamin Reed made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          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.
          Benjamin Reed made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Benjamin Reed made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Benjamin Reed made changes -
          Hadoop Flags [Reviewed]
          Hide
          Benjamin Reed added a comment -

          +1 looks good

          Show
          Benjamin Reed added a comment - +1 looks good
          Mahadev konar made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Hide
          Mahadev konar added a comment -

          retrying hudson.

          Show
          Mahadev konar added a comment - retrying hudson.
          Mahadev konar made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          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.
          Patrick Hunt made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Patrick Hunt made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Patrick Hunt made changes -
          Attachment ZOOKEEPER-677.patch [ 12438242 ]
          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.
          Mahadev konar made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Mahadev konar made changes -
          Attachment ZOOKEEPER-677.patch [ 12438240 ]
          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.
          Mahadev konar made changes -
          Attachment ZOOKEEPER-677.patch [ 12438238 ]
          Mahadev konar made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Mahadev konar made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Mahadev konar made changes -
          Attachment ZOOKEEPER-677.patch [ 12438238 ]
          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.
          Mahadev konar made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Mahadev konar made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Mahadev konar made changes -
          Attachment ZOOKEEPER-677.patch [ 12438237 ]
          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.
          Patrick Hunt made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          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.
          Mahadev konar made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Mahadev konar made changes -
          Attachment ZOOKEEPER-677.patch [ 12438065 ]
          Hide
          Mahadev konar added a comment -

          this patch should fix the issue.

          Show
          Mahadev konar added a comment - this patch should fix the issue.
          Mahadev konar made changes -
          Assignee Benjamin Reed [ breed ] Mahadev konar [ mahadev ]
          Mahadev konar made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          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()
          Mahadev konar made changes -
          Assignee Benjamin Reed [ breed ]
          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.
          Benjamin Reed made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Benjamin Reed made changes -
          Attachment ZOOKEEPER-677.patch [ 12436677 ]
          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
          Patrick Hunt made changes -
          Field Original Value New Value
          Link This issue blocks ZOOKEEPER-676 [ ZOOKEEPER-676 ]
          Patrick Hunt created issue -

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development