Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2944

DataFileReader has incorrect logic reading magic header

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.9.2
    • 1.10.1, 1.10.2
    • java
    • None

    Description

      When creating reader using static method which includes checking for magic header, we currently read 4 bytes but the pointer is not correctly updated.

      https://github.com/apache/avro/blob/328c539afc77da347ec52be1e112a6a7c371143b/lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java#L61-L62

      When inputstream reads less byte than expected, this will get stuck in the loop until the end of file. Or if inputstream returns -1, for EOF like S3AInpustream, read hangs in this loop.

      Attachments

        Issue Links

          Activity

            People

              mickjermsurawong-stripe Mick Jermsurawong
              mickjermsurawong-stripe Mick Jermsurawong
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified