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

CryptoOutputStream throws IOException on flush() if stream is closed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.3
    • 2.9.0, 3.0.0-alpha4, 2.8.2
    • None
    • None
    • Patch

    Description

      With Druid and Hadoop 2.7.3 I see that calls to flush() on a closed CryptoOutputStream throws IOException.

      Although flushing closed stream is dodgy, the culprit is actually CryptoOutputStream, according to the java documentation it look actually authorised.

      The OutputStream java doc (http://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html#flush()) shows that flush should behave like close(), which allows being called on a closed stream without exception (as opposed to write() and others which clearly says should throw an exception)

      Attachments

        1. CryptoOutputStream.flush-no-throw-on-closed.patch
          0.7 kB
          Pierre Lacave
        2. HADOOP-14346-1.patch
          0.7 kB
          Pierre Lacave

        Activity

          People

            pierre.lacave Pierre Lacave
            pierre.lacave Pierre Lacave
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: