Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-2988

Graph#save() may leak file descriptors

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      In hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/state/Graph.java :

        public void save(String filepath) throws IOException {
          OutputStreamWriter fout = new OutputStreamWriter(
              new FileOutputStream(filepath), Charset.forName("UTF-8"));
          fout.write(generateGraphViz());
          fout.close();
      

      The close of fout should be enclosed in finally clause.

        Attachments

        1. YARN-2988-001.patch
          0.9 kB
          Ted Yu
        2. YARN-2988-002.patch
          1.0 kB
          Ted Yu

          Activity

            People

            • Assignee:
              yuzhihong@gmail.com Ted Yu
              Reporter:
              yuzhihong@gmail.com Ted Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: