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

FileWriter should be closed in finally block in BlockReceiver#receiveBlock()

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      Here is code starting from line 828:

                  try {
                    FileWriter out = new FileWriter(restartMeta);
                    // write out the current time.
                    out.write(Long.toString(Time.now() + restartBudget));
                    out.flush();
                    out.close();
                  } catch (IOException ioe) {
      

      If write() or flush() call throws IOException, out wouldn't be closed.

        Attachments

        1. HDFS-6902.2.patch
          1 kB
          Tsuyoshi Ozawa
        2. HDFS-6902.1.patch
          1 kB
          Tsuyoshi Ozawa

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: