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

CryptoInputStream throwing wrong exception class on errors

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: fs
    • Labels:
    • Target Version/s:

      Description

      Having had a quick look at the CryptoInputStream class, it's not in sync with all the other filesystem's exception logic, as specified in src/site/markdown/filesystem/fsdatainputstream.md

      Operations MUST throw an IOException on out of bounds reads, ideally EOFException :

      1. read(byte[] b, int off, int len)
      2. {{seek(long pos) }}
      3. seekToNewSource

      The tests you want to extend to verify expected behaviour are in AbstractContractOpenTest and AbstractContractSeekTest

      also, the HasEnhancedByteBufferAccess implementations may want to think about using checkStream() before acting on a potentially closed stream.

        Attachments

        1. HADOOP-11042.001.patch
          57 kB
          Yi Liu

          Activity

            People

            • Assignee:
              hitliuyi Yi Liu
              Reporter:
              stevel@apache.org Steve Loughran
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: