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

Failure to update socket addresses on immedate connection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      I quote:

      void registerAndConnect(SocketChannel sock, InetSocketAddress addr)
      throws IOException

      { sockKey = sock.register(selector, SelectionKey.OP_CONNECT); boolean immediateConnect = sock.connect(addr); if (immediateConnect) { sendThread.primeConnection(); }

      }

      In the immediate case, there are several bugs:

      a) updateSocketAddresses() is never called, as it is when the select-loop in doTransport(). This means that clientCnxnSocket.getRemoteSocketAddress() will return null for the lifetime of this socket?
      b) CONNECT still in the interest set for the socket.
      c) updateLastSendAndHeard() is never called either.

      Attachments

        1. ZOOKEEPER-1684.diff
          3 kB
          Shevek

        Issue Links

          Activity

            People

              Unassigned Unassigned
              arren Shevek
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: