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

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

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.6.0
    • None
    • None

    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.1.patch
          1 kB
          Tsuyoshi Ozawa
        2. HDFS-6902.2.patch
          1 kB
          Tsuyoshi Ozawa

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment