ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1451

C API improperly logs getaddrinfo failures on Linux when using glibc

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.4.3
    • Fix Version/s: 3.5.0
    • Component/s: c client
    • Labels:
      None
    • Environment:

      Linux when using glibc

      Description

      This is how the code currently logs getaddrinfo errors:

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

      On Linux, specifically when using glibc, there is a better function for logging getaddrinfo errors called gai_strerror. An example:

      LOG_ERROR(("getaddrinfo: %s\n", gai_strerror(rc)));

      It doesn't miss a lot of cases like the errno based version does.

      1. ZOOKEEPER-1451.patch
        0.5 kB
        Stephen Tyree

        Activity

        Hide
        Hadoop QA added a comment -

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

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

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +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 (version 1.3.9) 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: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1044//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1044//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1044//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/12523375/ZOOKEEPER-1451.patch against trunk revision 1326029. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +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 (version 1.3.9) 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: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1044//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1044//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/1044//console This message is automatically generated.
        Hide
        Stephen Tyree added a comment -

        Is there anything else necessary here or are we good to go?

        Show
        Stephen Tyree added a comment - Is there anything else necessary here or are we good to go?
        Hide
        Michi Mutsuzaki added a comment -

        Sorry for the delay Stephen. The patch looks good. I'll check this in.

        Thanks!
        --Michi

        Show
        Michi Mutsuzaki added a comment - Sorry for the delay Stephen. The patch looks good. I'll check this in. Thanks! --Michi
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #1537 (See https://builds.apache.org/job/ZooKeeper-trunk/1537/)
        ZOOKEEPER-1451. C API improperly logs getaddrinfo failures on Linux when using glibc (Stephen Tyree via michim) (Revision 1330043)

        Result = SUCCESS
        michim : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1330043
        Files :

        • /zookeeper/trunk/CHANGES.txt
        • /zookeeper/trunk/src/c/src/zookeeper.c
        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #1537 (See https://builds.apache.org/job/ZooKeeper-trunk/1537/ ) ZOOKEEPER-1451 . C API improperly logs getaddrinfo failures on Linux when using glibc (Stephen Tyree via michim) (Revision 1330043) Result = SUCCESS michim : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1330043 Files : /zookeeper/trunk/CHANGES.txt /zookeeper/trunk/src/c/src/zookeeper.c

          People

          • Assignee:
            Stephen Tyree
            Reporter:
            Stephen Tyree
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development