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

DataFileReader leaks file descriptor on exception during construction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.8.2
    • 1.9.0
    • java
    • None

    Description

      The constructor DataFileReader(File, DatumReader) does not close the already opened file again when it throws an exception. This leads to a leaked file descriptor and especially to not being able to delete the still open invalid file then (at least on Windows).

      This case is important when Avro files may be truncated on write, e.g. due to a hard shutdown, and the application must be able to recover from such a situation on the next restart.

      Please see the attached file DataFileReaderCloseBug.java to reproduce the problem.

      I did not find that problem in Jira/mailing lists. Thanks for your help in advance 

      Attachments

        1. DataFileReaderCloseBug.java
          0.9 kB
          Holger Fleischmann

        Issue Links

          Activity

            People

              unchuckable Martin Jubelgas
              Holger Fleischmann Holger Fleischmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: