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

Improve stream use in QuorumCnxManager

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.2
    • Fix Version/s: None
    • Component/s: quorum, server

      Description

      I find three issues about stream object use in QuorumCnxManager. They are not bugs but may belong to bad practices.

      • Mismatch stream creation in RecvWorker and SendWorker.
        DataInputStream in RecvWorker is created by
        new DataInputStream(new BufferedInputStream(sock.getInputStream()))
        

        While DataOutputStream in SendWorker is created by

        new DataOutputStream(sock.getOutputStream)
        
      • Stream instances are never closed in RecvWorker and SendWorker.
      • RecvWorker and SendWorker are initialized before removing old ones.

        Attachments

        1. 1.patch
          4 kB
          IcySanwitch

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              spark_cachecheck IcySanwitch
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h