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

        Stephen Tyree created issue -
        Stephen Tyree made changes -
        Field Original Value New Value
        Attachment ZOOKEEPER-1451.patch [ 12523375 ]
        Stephen Tyree made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Affects Version/s 3.4.3 [ 12319288 ]
        Michi Mutsuzaki made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Fix Version/s 3.5.0 [ 12316644 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development