Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1451

C API improperly logs getaddrinfo failures on Linux when using glibc

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: 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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: