You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Martin Jubelgas (JIRA)" <ji...@apache.org> on 2018/12/19 20:38:00 UTC

[jira] [Commented] (AVRO-2286) DataFileReader leaks file descriptor on exception during construction

    [ https://issues.apache.org/jira/browse/AVRO-2286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16725327#comment-16725327 ] 

Martin Jubelgas commented on AVRO-2286:
---------------------------------------

Don't think that's a big one. I'll be trying to submit a fix for this ASAP. Thanks for providing a test, too ;)

> DataFileReader leaks file descriptor on exception during construction
> ---------------------------------------------------------------------
>
>                 Key: AVRO-2286
>                 URL: https://issues.apache.org/jira/browse/AVRO-2286
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.8.2
>            Reporter: Holger Fleischmann
>            Priority: Major
>         Attachments: DataFileReaderCloseBug.java
>
>
> 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 :)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)