Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-5943

IOUtils#copyBytes methods should not close streams that are passed in as parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • io
    • None
    • Incompatible change

    Description

      The following methods in IOUtils close the streams that are passed in as parameters. Calling these methods can easily trigger findbug OBL: Method may fail to clean up stream or resource (OBL_UNSATISFIED_OBLIGATION). A good practice should be to close a stream in the same method where the stream is opened.

      public static void copyBytes(InputStream in, OutputStream out, int buffSize, boolean close)
      public static void copyBytes(InputStream in, OutputStream out, Configuration conf, boolean close)

      These methods should be deprecated.

      Attachments

        1. HADOOP-5943.01.patch
          27 kB
          Andras Bokor
        2. HADOOP-5943.02.patch
          33 kB
          Andras Bokor
        3. HADOOP-5943.03.patch
          33 kB
          Andras Bokor

        Issue Links

          Activity

            People

              boky01 Andras Bokor
              hairong Hairong Kuang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: