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

ClientCnxn is not properly releasing the resources, which are used to ping RwServer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.4.6, 3.5.0
    • java client
    • None

    Description

      While pinging to the RwServer, ClientCnxn is opening a socket and using BufferedReader. These are not properly closed in finally block and could cause leaks on exceptional cases.

      ClientCnxn#pingRwServer()

                  try {
                      Socket sock = new Socket(addr.getHostName(), addr.getPort());
                      BufferedReader br = new BufferedReader(
                              new InputStreamReader(sock.getInputStream()));
                      ......
                      sock.close();
                      br.close();
                  } catch (ConnectException e) {
                      // ignore, this just means server is not up
                  } catch (IOException e) {
                      // some unexpected error, warn about it
                      LOG.warn("Exception while seeking for r/w server " +
                              e.getMessage(), e);
                  }
      

      Attachments

        1. 0001-ZOOKEEPER-1753.patch
          2 kB
          Rakesh Radhakrishnan
        2. 0001-ZOOKEEPER-1753-fix-branch-3_4.patch
          2 kB
          Rakesh Radhakrishnan
        3. 0002-ZOOKEEPER-1753.patch
          2 kB
          Rakesh Radhakrishnan

        Activity

          People

            rakeshr Rakesh Radhakrishnan
            rakeshr Rakesh Radhakrishnan
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: