Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-1753

Resource Leak in org.apache.hadoop.hdfs.server.namenode.StreamFile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.20.1, 0.23.0
    • None
    • namenode
    • None
    • Reviewed

    Description

      In doGet Method,
      final DFSInputStream in = dfs.open(filename);
      final long fileLen = in.getFileLength();
      OutputStream os = response.getOutputStream();
      Here this lines are present at out side of the try block.
      If response.getOutputStream() throws any exception then DFSInputStream will not be closed.So, better to move response.getOutputStream() into try block.

      Attachments

        1. HDFS-1753.patch
          7 kB
          Uma Maheswara Rao G
        2. HDFS-1753.4.patch
          12 kB
          Eli Collins
        3. HDFS-1753.3.patch
          11 kB
          Eli Collins
        4. HDFS-1753.2.patch
          8 kB
          Uma Maheswara Rao G
        5. HDFS-1753.1.patch
          7 kB
          Uma Maheswara Rao G

        Issue Links

          Activity

            People

              umamaheswararao Uma Maheswara Rao G
              umamaheswararao Uma Maheswara Rao G
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: