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

improve logging in leader election lookForLeader method when address resolution fails

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.2.0
    • quorum
    • None
    • Reviewed

    Description

      leader election has the following code:

      requestPacket.setSocketAddress(server.addr);
      LOG.info("Server address: " + server.addr);

      this should be switched to have the info log first, set sock addr second.

      The reason for this is that if the setSocketAddress fails SUN is not printing the address used. As a result it's verify difficult to debug this issue.

      If we log the server address first, then if the setSockAddress fails we'll see both the address of the server and the exception detail (right now we just see the exception detail which does not include the invlaid address in invalidAddressException).

      Attachments

        1. ZOOKEEPER-337.patch
          56 kB
          Patrick D. Hunt
        2. ZOOKEEPER-337.patch
          56 kB
          Patrick D. Hunt
        3. ZOOKEEPER-337.patch
          55 kB
          Patrick D. Hunt

        Activity

          People

            phunt Patrick D. Hunt
            phunt Patrick D. Hunt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: