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

C API improperly logs getaddrinfo failures on Linux when using glibc

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.4.3
    • 3.5.0
    • c client
    • None
    • 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

        1. ZOOKEEPER-1451.patch
          0.5 kB
          Stephen Tyree

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: